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

Read default region from config file #36

Open
samoconnor opened this issue Apr 19, 2018 · 0 comments
Open

Read default region from config file #36

samoconnor opened this issue Apr 19, 2018 · 0 comments

Comments

@samoconnor
Copy link
Contributor

Following from: #34 (comment)

... it doesn't seem quite right to duplicate the region env lookup and default (the other place is here: https://github.com/JuliaCloud/AWSCore.jl/blob/master/src/AWSCore.jl#L109)

There is a slight problem in that struct AWSCredentials does not have a region field so the region from the .config or .credentials file can't currently be accessed by the aws_config function. I propose the following:

  • Add a default_region::String field to struct AWSCredentials.
  • Set default_region=get(ENV, "AWS_DEFAULT_REGION", "us-east-1") in the default constructor
  • In dot_aws_credentials, set default_region if specified by the config files.
  • In the aws_config function, change the region= kw parameter to region=creds.default_region.
  • I think this should preserve existing behaviour, keep the default in one place, and add support for reading the region from the config files.
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

1 participant