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

Allow auto-detection of AWS region when using the vault CLI #14051

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

kalafut
Copy link
Contributor

@kalafut kalafut commented Feb 14, 2022

This PR lets the CLI detect the AWS region based on standard AWS credentials precedence (e.g. environment variables, or ~/.aws_credentials) if the region is specified as auto. Previously you either had to provide the region manually, or accept the default of us-east-1.

The region calculation was verified manually (using by temporarily logging the computed region):

➜  vault git:(aws-region-detect) ✗ vault login -method=aws
us-east-1

➜  vault git:(aws-region-detect) ✗ vault login -method=aws region=
us-east-1

➜  vault git:(aws-region-detect) ✗ vault login -method=aws region=abc123
abc123

➜  vault git:(aws-region-detect) ✗ vault login -method=aws region=auto
us-west-2

@kalafut kalafut added this to the 1.10 milestone Feb 14, 2022
@kalafut kalafut requested a review from a team February 14, 2022 17:37
@vercel vercel bot temporarily deployed to Preview – vault February 14, 2022 17:38 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook February 14, 2022 17:38 Inactive
@kalafut kalafut requested review from calvn and removed request for a team February 14, 2022 17:40
@kalafut kalafut merged commit 4d1475b into main Feb 14, 2022
@kalafut kalafut deleted the aws-region-detect branch February 14, 2022 20:01
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

Successfully merging this pull request may close these issues.

2 participants