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

decdk: Can't apply Fn::GetAtt to raw CloudFormation #2005

Closed
cohalz opened this issue Mar 12, 2019 · 4 comments
Closed

decdk: Can't apply Fn::GetAtt to raw CloudFormation #2005

cohalz opened this issue Mar 12, 2019 · 4 comments
Assignees
Labels
bug This issue is a bug. p2 package/decdk Related to the Declarative CDK package

Comments

@cohalz
Copy link
Contributor

cohalz commented Mar 12, 2019

All parts using Fn::GetAtt will be empty resources by cdk 0.25.3.

here is a short code.

Resources:
  MyQueue:
    Type: "@aws-cdk/aws-sqs.Queue"
    Properties:
      fifo: true
  MyLogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName:
        Fn::GetAtt: MyQueue.Arn
$ npx cdk -a "npx decdk hello.yml" synth
Resources:
  MyQueueE6CA6235:
    Type: AWS::SQS::Queue
    Properties:
      FifoQueue: true
    Metadata:
      aws:cdk:path: hello/MyQueue/Resource
  MyLogGroup:
    Type: AWS::Logs::LogGroup
    Properties: {}
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=0.25.2,@aws-cdk/aws-cloudwatch=0.25.3,@aws-cdk/aws-iam=0.25.3,@aws-cdk/aws-kms=0.25.3,@aws-cdk/aws-s3-notifications=0.25.3,@aws-cdk/aws-sqs=0.25.3,@aws-cdk/cdk=0.25.3,@aws-cdk/cx-api=0.25.3,jsii-runtime=node.js/v10.15.2

In addition, Cloudformation of ECS created by CDK will also become an empty resource as well.

~/s/decdktest ❯❯❯ npx cdk -a "npx decdk my-sample-ecs.yml" synth >! my-sample-ecs-cdk.yml
The stack my-sample-ecs already includes a CDKMetadata resource
~/s/decdktest ❯❯❯ diff my-sample-ecs.yml my-sample-ecs-cdk.yml
9,12d8
<       SourceSecurityGroupId:
<         Fn::GetAtt:
<           - AlbSecurityGroup580F65A6
<           - GroupId
128,131d123
<       ExecutionRoleArn:
<         Fn::GetAtt:
<           - TaskDefExecutionRoleB4775C97
<           - Arn
137,140d128
<       TaskRoleArn:
<         Fn::GetAtt:
<           - TaskDefTaskRole1EDB4A67
<           - Arn
192,195d179
<             Resource:
<               Fn::GetAtt:
<                 - LogGroupF5B46931
<                 - Arn
232,235c216
<       SecurityGroups:
<         - Fn::GetAtt:
<             - AlbSecurityGroup580F65A6
<             - GroupId
---
>       SecurityGroups: []
260,263d240
<       GroupId:
<         Fn::GetAtt:
<           - AlbSecurityGroup580F65A6
<           - GroupId
311,314c288,289
<         - - Fn::GetAtt:
<               - Alb16C2F182
<               - DNSName
<           - /ui
\ No newline at end of file
---
>         - - /ui
>
@cohalz
Copy link
Contributor Author

cohalz commented Mar 12, 2019

At least, I confirmed that these functions can pass correctly.

  • Fn::Sub
  • Fn::Join
  • Fn::Select
  • Fn::Split
  • Ref

@cohalz
Copy link
Contributor Author

cohalz commented Mar 20, 2019

@eladb What about this? Is it in progress?

@eladb
Copy link
Contributor

eladb commented Mar 20, 2019

It's a bug, but we haven't had a chance to look at this.

@eladb eladb added bug This issue is a bug. package/decdk Related to the Declarative CDK package labels Mar 20, 2019
@eladb eladb self-assigned this Apr 2, 2019
@eladb eladb removed their assignment May 5, 2019
@eladb eladb self-assigned this Aug 12, 2019
@eladb eladb added the p1 label Oct 23, 2019
@eladb eladb added p2 and removed p1 labels Nov 4, 2019
@eladb
Copy link
Contributor

eladb commented Aug 4, 2020

Stale

@eladb eladb closed this as completed Aug 4, 2020
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. p2 package/decdk Related to the Declarative CDK package
Projects
None yet
Development

No branches or pull requests

2 participants