cloudformation-include: setting templateOptions.description
appends the description in the imported stack, rather than replacing it
#28932
Labels
@aws-cdk/cloudformation-include
Issues related to the "CFN include v.20" package
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Describe the bug
I import a stack and set
description
in my stack's props. Instead of overriding the imported description, it appends the description from the imported stack to the provided description. There seems to be no way of fixing this other than changing the description in the imported template.Use case: We have outgrown Amplify and are working on rebuilding our stack in CDK with as smooth of a transition as possible, as the backend is being used in production, and the Amplify backend is still actively being developed. As such, we want CDK to generate templates as similar as possible to what Amplify produces, so we want to remove everything possible from the diff to ensure we aren't missing anything. Amplify often changes up the description in the templates it produces, but cfn sometimes doesn't actually update the description (unless you also add tags) so the Amplify generated template won't match what's currently in cfn. So we try to override the description in cdk with
this.templateOptions.description
, but it just prepends it to the imported description.Expected Behavior
this.templateOptions.description
should override the description. I can override anything else from an imported stack, and the description should be no exception.Current Behavior
CDK provided description is prepended to imported description. If imported description is
{"createdOn":"Windows","createdBy":"Amplify","createdWith":"12.10.1","stackType":"auth-Cognito","metadata":{}}
and CDK provided description isAmplify Cognito Stack for AWS Amplify CLI
(to match what is already in cfn, which for whatever reason doesn't update along with the rest of the stack), the description becomesand there is no way to get it out of the diff.
Reproduction Steps
cloudformation-include
that has a descriptionthis.templateOptions.description = 'New Description'
after the importcdk diff
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.124.0 (build 4b6724c)
Framework Version
No response
Node.js Version
v20.11.0
OS
Windows 11 22H2
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: