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

Default / override region is not added to the config #481

Closed
viraptor opened this issue Jun 17, 2023 · 6 comments · Fixed by #492
Closed

Default / override region is not added to the config #481

viraptor opened this issue Jun 17, 2023 · 6 comments · Fixed by #492
Labels
enhancement New feature or request
Milestone

Comments

@viraptor
Copy link

Output of aws-sso version:

AWS SSO CLI Version 1.9.10 -- Copyright 2021-2022 Aaron Turner
unknown (nixpkgs) built at unknown

Describe the bug:
The configuration for the default region does not seem to be applied to the aws config.

To Reproduce:
Current config:

SSOConfig:
  Default:
    SSORegion: us-east-1
    StartUrl: ...
    DefaultRegion: us-east-1
    Accounts:
      "718...":
        DefaultRegion: eu-west-1
DefaultRegion: us-east-1
...

Config generated with aws-sso config-profiles does not include the default region settings.
aws-vault exec ... -- aws ec2 complains about missing AWS_REGION.

Expected behavior:
Expected the region = ... setting to be added to my generated .aws/config.yaml file.

Desktop (please complete the following information):

  • OS: macOS / nixpkgs
  • Version Ventura / nixpkgs-23.05

Additional context:
Add any other context about the problem here.

@viraptor viraptor added the bug Something isn't working label Jun 17, 2023
@synfinatic synfinatic added enhancement New feature or request and removed bug Something isn't working labels Jun 19, 2023
@synfinatic
Copy link
Owner

synfinatic commented Jun 19, 2023

DefaultRegion is for $AWS_DEFAULT_REGION https://github.com/synfinatic/aws-sso-cli/blob/main/docs/config.md#defaultregion

Sadly, different AWS SDK's use different ENV variables, because why have 1 standard when 2 will do?

@viraptor
Copy link
Author

It doesn't seem to work either way. With config as above, I run:

aws-vault exec role-in-718... -- env | grep AWS

And there's no AWS_DEFAULT_REGION available.

@viraptor
Copy link
Author

I guess I'm saying the equivalent to ConfigVariables per-role would be good to have, the same way we have DefaultRegion available per-account and per-role right now.

@synfinatic
Copy link
Owner

Uh, the command is aws-sso not aws-vault? aws-vault is a different program. :)

@synfinatic
Copy link
Owner

synfinatic commented Jun 19, 2023

$ set | grep REGION


$ aws-sso eval --profile View | grep REGION
export AWS_SSO_DEFAULT_REGION="us-west-2"
export AWS_DEFAULT_REGION="us-west-2"

@viraptor
Copy link
Author

Correct. aws-sso exec works just fine. But the regions could be configured in the .aws/config as well, which is used by other apps - since the setting already exists in aws-sso's config.

@synfinatic synfinatic added this to the next release milestone Jul 27, 2023
synfinatic added a commit that referenced this issue Jul 27, 2023
If the user has set `DefaultRegion` in the `~/.aws-sso/config.yaml`
file, then that will be set in the `~/.aws/config` file as the
`region` option for the profile.

Fixes: #481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants