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

Support an option to only set the AWS_PROFILE variable #161

Open
felipe1982 opened this issue Jun 10, 2021 · 1 comment
Open

Support an option to only set the AWS_PROFILE variable #161

felipe1982 opened this issue Jun 10, 2021 · 1 comment

Comments

@felipe1982
Copy link

Sometimes it's useful to have AWS_ACCESS_KEY and other associated env vars, but other times it is better to just use AWS_PROFILE, and unset all the other AWS_* variables.

When I refresh my creds, I normally have to re-run awsume . If only AWS_PROFILE was set, I would not need to do that.

Workflow example

  1. set credentials using saml (saml2aws)
  2. run awsume
  3. aws s3 ls
  4. credentials time out
  5. set credentials using saml
  6. run awsume # I could save this step #
  7. aws s3 ls
@1oglop1
Copy link

1oglop1 commented Jun 25, 2021

I use awsume together with (direnv)[https://direnv.net/]
you can pack all these steps in one script inside .envrc or have direnv watch .aws/credentials for change - it should change by saml2aws.
Then you can just: cd <my_project>, sign in, work. And when credetials expire direnv reload.

Honestly, most tools I worked with did not honour AWS_PROFILE - this is where I find direnv best tool to organize it.

I did not use saml2aws but it seems to have an option (script)[https://github.com/Versent/saml2aws#saml2aws-script] - but I assume it may not work for your use case because you have to authenticate against the parent account and then assume the role in the child account.

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

No branches or pull requests

3 participants