-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(cfn-include): support logical id overrides #8529
feat(cfn-include): support logical id overrides #8529
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
abeafbe
to
287d48f
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -110,11 +122,11 @@ export class FromCloudFormation { | |||
return ret; | |||
} | |||
|
|||
public static parseCreationPolicy(policy: any): CfnCreationPolicy | undefined { | |||
public static parseCreationPolicy(policy: any, options: ParseCfnOptions): CfnCreationPolicy | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing around all the options everywhere feels a little dirty to me.
I'd think I'd prefer a class CfnParser
or something which has the resolver as a member.
Not going to force you to change it, but I have a feeling it will be cleaner. Give it a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. @rix0rrr let me know if you like this way better.
…e template Previously, we created the Tokens needed for references like Ref and Fn::GetAtt without actually referencing the created L1s in the template, just by their logical IDs. That's not strictly correct, because users of CfnInclude can call overrideLogicalId() on the CloudFormation elements retrieved from the template, and we need to make sure to also reflect that in all references to that resource. Change the code converting from CloudFormation to CDK values to actually retrieve the appropriate L1 objects when encountering expressions like Ref and Fn::GetAtt. This also gives us correctly working cross-stack references for free. Related to aws#7375
287d48f
to
cb57a09
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Previously, we created the Tokens needed for references like
Ref
andFn::GetAtt
without actually referencing the created L1s in the template,
just by their logical IDs.
That's not strictly correct,
because users of
CfnInclude
can calloverrideLogicalId()
on the CloudFormation elements retrieved from the template,
and we need to make sure to also reflect that in all references to that resource.
Change the code converting from CloudFormation to CDK values to actually retrieve
the appropriate L1 objects when encountering expressions like
Ref
andFn::GetAtt
.This also gives us correctly working cross-stack references for free.
Related to #7375
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license