cdk deploy: reports no changes despite cloudformation would report changes #27013
Labels
@aws-cdk/aws-cloudformation
Related to AWS CloudFormation
bug
This issue is a bug.
duplicate
This issue is a duplicate.
Describe the bug
Running
cdk deploy
successfully synths and then immediately reports:(then nothing happens, cdk is finished)
However there is some
Fn::Transform
in the Template which would lead to changes in Cloudformation.When running with
--execute=false
and then having a look at the Changeset in Cloudformation (aws web console), it correctly shows the changes that would have been done by theFn::Transform
. (This Changeset can be executed)If done with Cloudformation and a similar Template (Same
Fn::Transform
), the aws cli will upload the Cloudformation Template, Cloudformation processes the Template and then performs the changes.Expected Behavior
cdk behaves like
aws cloudformation deploy
, just uploads and let cloudformation figure out if there are changes or not.Current Behavior
CDK does not upload to Cloudformation, does some internal computation (0.38 seconds) and then exits reporting "no changes"
Reproduction Steps
Have a
Fn::Transform
in the Template which returns different output each time it is run.Possible Solution
Short Term:
Provide an option like
--force-upload=true
to ensure cdk will always upload the template to CloudformationMid Term:
Automatically upload if `Fn::Transforms is in the Template.
Long Term:
No Idea how CDK currently detects changes, but this should be fixed there.
Additional Information/Context
See Example files at https://gist.github.com/marvinside/67e0cafa7081e45197e00091ffbea90e
CDK CLI Version
2.89.0 (build 2ad6683)
Framework Version
"aws-cdk-lib": "2.89.0"
Node.js Version
v16.20.1
OS
OSX
Language
Typescript
Language Version
5.1.6
Other information
Background Information
Each AWS Account has some Tags which should be applied to all Resources. These Tags are Stored in SSM.
The
Fn::Transform
will load these tags and apply them.It might be possible that new tags are added, therefore a re-deploy will upload the same template but results in changes in the post-processed template.
The text was updated successfully, but these errors were encountered: