-
Notifications
You must be signed in to change notification settings - Fork 4.1k
aws-cdk: assumed roles using source_profile from SSO sources cannot get credentials #19897
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
Comments
I might be wrong about it being an upstream issue. I've tested swapping the source profile (using SSO) with static credentials, and that appears to work ok, so it might be an issue with the credentials provider chain in AWS Config that worked:
|
Thanks for opening the issue @elliotsegler! @comcalvi you might want to take a look at this one. |
I've been tinkering with this and In this case, my-assumed-sso-role is being eaten by the I think there's actually two issues here:
This particular issue was fixed upstream, but in the v3 SDK with some resolver logic (see aws-sdk-js-v3:packages/credential-provider-ini/src) |
@elliotsegler I haven't been able to reproduce this yet. This is my
|
Hey @comcalvi Checking my copy of the CDK, yes - the versions are the same.
I think the issue with your reproduction is an issue with your
|
I'll also suggest that my |
Thanks for the detailed explanation @elliotsegler. I'm still working on a reproduction, but with an empty credentials file, I can use a role that trusts the sso role, as you described, and successfully synth a stack. I'll look more into this later. |
@comcalvi: Are you seeing issues resolving credentials while synthing? Being able to synth a stack is not what I'd consider success criteria. It's possible for the credentials process to fail and for the stack to still synth. This is the same for any cdk command like In the case I've got, I'm using a VPC lookup. So on a synth with an empty context it would fail. If I manually set the context, or I use a non-sso profile/creds to fetch and set the context, every subsequent synth works even if it can't fetch credentials. Are you able to |
you're right,
for both the SSO role and the role that trusts the existing SSO role. This is definitely broken, I'll be working on a fix for this. |
turns out when using source profiles, the CDK will always try to create a |
SSO profiles can now be used as source profiles. Fixes #19897. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
SSO profiles can now be used as source profiles. Fixes aws#19897. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When trying to acquire credentials using a assumed role
source_profile
connected to an SSO profile, I receive the following errorExpected Behavior
Credentials to be loaded correctly, and ProcessCredentialsProviderFailure not to be called. ProcessCredentialsProvider should not be used in this case.
Current Behavior
Trace logs:
Reproduction Steps
~/.aws/config
contains SSO profile and an assumed role profile~/.aws/credentials
is currently empty, but I've tried with a default profile and it doesn't make a differenceRunning
npx cdk synth --profile my-assumed-sso-role
causes the error.Running
aws sts get-caller-identity --profile my-assumed-sso-role
shows a valid session.Possible Solution
Possibly bump the bundled aws-sdk version
Additional Information/Context
No response
CDK CLI Version
2.20.0 (build 738ef49)
Framework Version
No response
Node.js Version
v16.14.2
OS
Windows
Language
Typescript
Language Version
No response
Other information
I suspect that it's actually an upstream issue with
aws-sdk
related tosource_profile
which was recently fixed, such as aws/aws-sdk-js-v3#2221The text was updated successfully, but these errors were encountered: