-
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
(cli): CDK CLI not working with SSO #30303
Comments
Can you help us check:
|
Yes, this gives the correct identity.
Shown below.
No, this has the same result. The verbose output:
|
Possibly related possibly not if you have a |
Try reconfiguring SSO. I was still set up for legacy access - switching to the new identity centre SSO config fixed this for me: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html |
Describe the bug
The cdk cli is not working with my sso profile.
If I export my profile to envars it works. So that seems like there is nothing wrong with the account and something wrong with the way cdk reads the sso profile.
I login using
aws sso login --profile my-profile
.When I run
cdk bootstrap aws://<my-account>/<my-region> --profile my-profile
there is an errorNeed to perform AWS calls for account 413304634307, but no credentials have been configured
Expected Behavior
I expect to be able to run:
aws sso login --profile my-profile
cdk bootstrap aws://my-account/my-region --profile my-profile
Current Behavior
Current behaviour is that this throws an error "Need to perform AWS calls for account 413304634307, but no credentials have been configured"
However, if I add a step to export to envars it does work.
This works:
1.
aws sso login --profile my-profile
2.
$(aws configure export-credentials --profile my-profile --format env)
3.
cdk bootstrap aws://my-account/my-region --profile my-profile
Reproduction Steps
Run this and see the error because sso profile doesn't work:
aws sso login --profile my-profile
cdk bootstrap aws://my-account/my-region --profile my-profile
Run this and it works because it has the envars it wants:
1.
aws sso login --profile my-profile
2.
$(aws configure export-credentials --profile my-profile --format env)
3.
cdk bootstrap aws://my-account/my-region --profile my-profile
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.142.1 (build ed4e152)
Framework Version
No response
Node.js Version
v20.12.0
OS
WSL Ubuntu 22.04.4 LTS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: