-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 diff: in 2.134.0 diff fails if deploy
cannot be assumed
#29650
Comments
Also: running with the top level role seems like an oversight - in theory that role could have more permissions than intended. I also tried running with |
On the above, when I run with
-> because it should be |
Hey @Smeb, once you caught the typo in our docs, did running diff with the correct spelling of the flag solve your issue? I believe in v2.134 that we put logic in exactly for this case, so I want to make sure you are not still running into issues. |
Yes, using the correct flag did work around the issue - I would still expect to not fall back to the parent role though (that, or the change in behaviour would be worth documentation) |
@Smeb, good to hear. Yes, this should be documented. Thanks for your PR! We are also adding |
@Smeb, after some digging, there is a deeper problem here. Before, if the deploy role could not be assumed, we caught the error in the changeset creation and defaulted back to the classic diff behavior. Now, if the describeStacks call fails, we hard fail. I have made a PR that both handles the error if describeStacks fails and attempts to use the lookup role for the call in the first place. Thanks again for reporting this. |
…29718) Closes #29650 ### Description of changes This addresses the issue in two ways: 1. If the describeStacks call errors out, we now catch it and default to classic diff behavior. 2. The describeStacks call now tries to use the lookup role rather than the deploy role. ### Description of how you validated changes Manual testing with a user that could only assume lookup roles. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
In our CI we have a readonly role with access to the
lookup
role, but not thedeploy
role for non protected branches.In version 2.133.0 running diff works - in 2.134.0 we get a crash.
For now we fixed it by pinning the previous version.
Expected Behavior
Diffing with a role which can assume the
lookup
role worksCurrent Behavior
Diffing with a role which cannot assume
deploy
fails.Not clear what's happening here - I guess after failing to assume the
deploy
role the current role is the ci role which attempted to assumedeploy
, and then afterDescribeStacks
is called.Reproduction Steps
I don't think I can easily provide this, since you would need to set up the same roles, stacks, etc. This does work with a higher privilege role, which indicates it's to do with the role assumption.
cdk diff --all --ci
Possible Solution
Ensure that the
lookup
role is still used after trying to assume thedeploy
role and failing.Additional Information/Context
No response
CDK CLI Version
v2.134.0
Framework Version
No response
Node.js Version
20
OS
Darwin
Language
Go
Language Version
1.22
Other information
No response
The text was updated successfully, but these errors were encountered: