Disable fallback to user's role when a cdk-*
role cannot be assumed
#30236
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
When running
deploy
ordestroy
commands, it would be amazing if the CDK would fail when acdk-*
role cannot be assumed (e.g.cdk-lookup
orcdk-deploy
).Use Case
It's very easy to use/paste an incorrect Account ID in the
CDK_DEPLOY_ACCOUNT
when running CDK locally. When that happens, users can accidentally deploy local changes to the production environments.I know that it would have to be a coincidence of selecting the wrong account ID along with the wrong profile. However, if CDK would not fall back to the user's profile by default, it would be possible to define a
Trust policy
at thecdk-*
role level allowing only pipelines (e.g. OIDC roles) to perform production deployments.Proposed Solution
cdk-*
role cannot be assumed.--force
parameter that would fall back to the user's role even if the CDK roles can't be assumed.Other Information
No response
Acknowledgements
CDK version used
2.140.0
Environment details (OS name and version, etc.)
macOS 14.5
The text was updated successfully, but these errors were encountered: