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

(aws-cdk): cdk diff always fallback to no change-set diff #28753

Closed
singlewind opened this issue Jan 18, 2024 · 3 comments · May be fixed by #32830
Closed

(aws-cdk): cdk diff always fallback to no change-set diff #28753

singlewind opened this issue Jan 18, 2024 · 3 comments · May be fixed by #32830
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@singlewind
Copy link

Describe the bug

We are migrating cloudformation template to CDK. In our CDK stack, we have included a cloudformation template. When we run diff, it shows warning

Failed to create change set with error: 'The following CloudFormation Parameters are missing a value: XXX, YYY, ZZZ', falling back to no change-set diff

I tried to specify parameters with --parameters XXX=xxx,YYY=yyy,ZZZ=zzz flag. But no luck. As I know, cdk deploy has this flag. How can we specify in cdk diff

Expected Behavior

cdk diff stackName --parameters XXX=xxx,YYY=yyy,ZZZ=zzz will create a changeset in AWS Cloudformation and display the difference. Then remove the changeset.

Current Behavior

Just show the difference against the current included cloudformation template.

Reproduction Steps

cdk diff stackName --parameters XXX=xxx,YYY=yyy,ZZZ=zzz

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.121.1

Framework Version

No response

Node.js Version

20

OS

ubuntu

Language

TypeScript

Language Version

5.3.3

Other information

No response

@singlewind singlewind added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 18, 2024
@singlewind singlewind changed the title (aws-cdk): (cdk diff always fallback to no change-set diff) (aws-cdk): cdk diff always fallback to no change-set diff Jan 18, 2024
@pahud
Copy link
Contributor

pahud commented Jan 19, 2024

Can you share a minimal CFN template that reproduces this issue? I am guessing your template may not have those parameters defined but I am not 100% sure.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 19, 2024
@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 4, 2024
Copy link

github-actions bot commented Jun 5, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 5, 2024
@msessa
Copy link

msessa commented Jan 9, 2025

It would be great if we could pass an option to cdk diff to disable falling back to template only diff.

This would be particularly useful to catch errors returned by change-set level Hooks or by transform macros early, ideally before deployment.

As a use case, we have a Macro+Transform that performs an online lookup for a group in Identity Center. If the group doesn't exist the transform will report an error but that ends up not being displayed when using cdk diff.

Sample output:

$ npx cdk diff -e my-stack
Hold on while we create a read-only change set to get a diff with accurate replacement information (use --no-change-set to use a less accurate but faster template-only diff)
Could not create a change set, will base the diff on template differences (run again with -v to see the reason)

Sample output with verbose enabled

$ npx cdk diff -v -e my-stack
[01:45:37] CDK toolkit version: 2.174.1 (build f353fc7)
...
[01:45:43] Attempting to create ChangeSet with name cdk-diff-change-set for my-stack
[01:45:43] Initiated creation of changeset: arn:aws:cloudformation:ap-southeast-4:0000000000:changeSet/cdk-diff-change-set/8e57cbbf-c97c-491e-8cfe-76015ecb7066; waiting for it to finish creating...
[01:45:43] Waiting for changeset cdk-diff-change-set on stack my-stack to finish creating...
[01:45:44] Changeset cdk-diff-change-set on stack my-stack is still creating
[01:45:49] Error: Failed to create ChangeSet cdk-diff-change-set on my-stack: FAILED, Transform 000000000::GroupIdResolver failed with: Cannot find the group named 'NonExistingGroup'.

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. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants