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

Configure aws-vault to cache role tokens #1222

Open
2 tasks done
Supermathie opened this issue Aug 29, 2023 · 2 comments
Open
2 tasks done

Configure aws-vault to cache role tokens #1222

Supermathie opened this issue Aug 29, 2023 · 2 comments

Comments

@Supermathie
Copy link

We would like to have aws-vault cache role tokens.

By default, a new session is created for every invocation which means a round trip to AWS and back to retrieve the new token. For our people in more remote regions this means a round trip on every invocation which we'd like to avoid.

We ask that instead of retrieving a new role token on every call, we can instruct aws-vault to remember it for a period of time and return that instead of a new one.

If this is not already possible, would you be open to a PR implementing such a thing?

e.g. instead of:

○ → aws-vault export prod | grep AWS_ACCESS_KEY_ID
AWS_ACCESS_KEY_ID=ASIAQ2NCZ6TQXGPG4QWB

○ → aws-vault export prod | grep AWS_ACCESS_KEY_ID
AWS_ACCESS_KEY_ID=ASIAQ2NCZ6TQRW6FRWUG

we get:

○ → aws-vault export prod | grep AWS_ACCESS_KEY_ID
AWS_ACCESS_KEY_ID=ASIAQ2NCZ6TQXGPG4QWB

○ → aws-vault export prod | grep AWS_ACCESS_KEY_ID
AWS_ACCESS_KEY_ID=ASIAQ2NCZ6TQXGPG4QWB
  • I am using the latest release of AWS Vault
    using arch aws-vault 7.2.0-1
  • I have provided my .aws/config (redacted if necessary)
[default]
cli_pager =
region = us-east-1

[profile root-account]
mfa_serial = arn:aws:iam::111111111111:mfa/supermathie

[profile prod]
source_profile = root-account
role_arn = arn:aws:iam::222222222222:role/admin
mfa_serial = arn:aws:iam::111111111111:mfa/supermathie
region = us-west-2
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Feb 26, 2024
@blowfishpro
Copy link

The extra round trips can add up. One example is where IAM roles are used to provide EKS access tokens, and then some scripting is done around kubectl that ends up invoking the token generator multiple times.

@github-actions github-actions bot removed the stale label Feb 27, 2024
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