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

Region setup #55

Open
jonerer opened this issue Aug 23, 2021 · 1 comment
Open

Region setup #55

jonerer opened this issue Aug 23, 2021 · 1 comment

Comments

@jonerer
Copy link

jonerer commented Aug 23, 2021

Hello!

Thanks for an awesome project! We are using awsu for authentication for our aws mfa setup. Now we're expanding operations and are going to set up an aws account in a different region. We currently use awsu to switch profiles between aws accounts with profiles. We would like for awsu to also manage the region differences, which it seems not to do at the moment:

➜  ~ awsu -p dev-rp-prod
export AWSU_EXPIRES=2021-08-23T10:21:48+02:00
export AWS_ACCESS_KEY_ID=AS...GA
export AWS_SECRET_ACCESS_KEY=CZv....73
export AWS_SESSION_TOKEN=Fw....0bA==

In order to handle regions, awsu would also set the env var "AWS_DEFAULT_REGION". In the AWS config file format this should be called "region": https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html. In "config" we have

[default]
region = eu-west-1
output = json

If we could do something like

[us]
region = us-east-1
output = json

[dev-rp-us-prod]
mfa_serial = arn:aws:iam::815...4:mfa/username-aws
role_arn = arn:aws:iam::815....4:role/MyRole
source_profile = us

That would be awesome. Thoughts?

@jonerer
Copy link
Author

jonerer commented Aug 23, 2021

Using "source_profile" like that is just an example. We could put the "region" attribute directly under the "dev-rp-us-prod" section if that makes implementation easier.

Basically any way that could make awsu -p dev-rp-prod -- aws ec2 describe-availability-zones --output text --query 'AvailabilityZones[0].[RegionName]' work. Cause right now we need to specify region separately, like awsu -p dev-rp-prod -- aws ec2 describe-availability-zones --region us-east-1 --output text --query 'AvailabilityZones[0].[RegionName]'

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

2 participants