Skip to content

CfnInclude adds garbage $jsii.map key #4957

@joekiller

Description

@joekiller

When using CDK 1.16.0 the CfnInclude command inserts garbage keys name "$jsii.map"

Reproduction Steps

from aws_cdk import (
    core
)

app = core.App()
stack = core.Stack(app, "stack")
core.CfnInclude(stack, "RawStack", template={
    "Resources": {
        "MySnsTopic": {
            "Type": "AWS::SNS:Topic"
        }
    }
}
                )
core.CfnOutput(stack, "TopicName", value=core.Fn.get_att('MySnsTopic', 'TopicName').to_string())
app.synth()

Error Log

>cdk synth 
$jsii.map:
  Resources:
    $jsii.map:
      MySnsTopic:
        $jsii.map:
          Type: AWS::SNS:Topic
Outputs:
  TopicName:
    Value:
      Fn::GetAtt:
        - MySnsTopic
        - TopicName
Resources:
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.16.0,@aws-cdk/core=1.16.0,@aws-cdk/cx-api=1.16.0,jsii-runtime=Python/3.7.4
    Condition: CDKMetadataAvailable
Conditions:
  CDKMetadataAvailable:
    Fn::Or:
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ca-central-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-northwest-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-central-1
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-2
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-3
          - Fn::Equals:
              - Ref: AWS::Region
              - me-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - sa-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-2
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-2

Environment

  • CLI Version : 1.16.0 (build ca503f4)
  • Framework Version: 1.16.0
  • OS : Arch Linux
  • Language : Python

This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.p0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions