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

source_profile cannot be the same as profile #6

Open
neilmayhew opened this issue Aug 28, 2018 · 1 comment
Open

source_profile cannot be the same as profile #6

neilmayhew opened this issue Aug 28, 2018 · 1 comment

Comments

@neilmayhew
Copy link

I had a setup with a profile called xxx in ~/.aws/config and a source profile called xxx in ~/.aws/credentials. This seemed logical to me and it worked with plain aws, ie aws --profile xxx. However, it confuses aws-env --profile xxx. Trying to run any command results in:

An error occurred (AccessDenied) when calling the GetSessionToken operation: Cannot call GetSessionToken with session credentials

At the least this restriction should be documented, and ideally it should be removed.

@borsboom
Copy link
Member

borsboom commented Sep 1, 2018

Does the xxx profile in ~/.aws/config have an mfa_serial or role_arn? If so, I think I know why this would be problematic. aws-env uses aws --profile="$SRC_PROFILE" sts get-session-token when creating session credentials for MFA, but aws will implicitly create session credentials before making the STS API call (which can't be called with session credentials). I can't think of a trivial fix for this. One possibility: aws-env would have to parse ~/.aws/credentials itself and then set the AWS_* environment variables with those, rather than using aws --profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants