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

cdk deploy: reports no changes despite cloudformation would report changes #27013

Closed
marvinside opened this issue Sep 5, 2023 · 2 comments
Closed
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. duplicate This issue is a duplicate.

Comments

@marvinside
Copy link

Describe the bug

Running cdk deploy successfully synths and then immediately reports:

CdkTestStack: deploying... [1/1]

 ✅  CdkTestStack (no changes)

✨  Deployment time: 0.38s

(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 the Fn::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 Cloudformation

Mid 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.

@marvinside marvinside added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2023
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Sep 5, 2023
@peterwoodworth
Copy link
Contributor

CDK uses createChangeSet, not the deploy API. We provide options on the CLI --force and --method direct to adjust how deployment works. If this doesn't work, we're tracking the issue here #15065

@peterwoodworth peterwoodworth added duplicate This issue is a duplicate. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2023
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants