Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CfnInclude adds garbage $jsii.map key #4957

Closed
joekiller opened this issue Nov 11, 2019 · 4 comments · Fixed by #4965
Closed

CfnInclude adds garbage $jsii.map key #4957

joekiller opened this issue Nov 11, 2019 · 4 comments · Fixed by #4965
Assignees
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p0

Comments

@joekiller
Copy link

joekiller commented Nov 11, 2019

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

@joekiller joekiller added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2019
@joekiller joekiller changed the title CfnImport adds garbage $jsii.map key CfnInclude adds garbage $jsii.map key Nov 11, 2019
@eladb eladb added the p0 label Nov 11, 2019
@eladb
Copy link
Contributor

eladb commented Nov 11, 2019

Thanks for the report @joekiller. We are invesgtigating. In the meantime, I suggest you didn't upgrade to the latest version.

@RomainMuller
Copy link
Contributor

I can confirm I'm able to reproduce. This is caused by the template property being typed object triggering an unexpected code path.

@RomainMuller
Copy link
Contributor

Confirmed I have a working fix from the JSII kernel. This will require a new JSII release as well as a new CDK release using that.

@joekiller
Copy link
Author

Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants