-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
AWS provider should use default region set in ~/.aws/config/ #687
Comments
I'm wondering why this is marked as an enhancement ? Perhaps this isn't the exact issue that I'm looking for a solution. https://www.terraform.io/docs/providers/aws/index.html#region I'm looking for a solution where the region is set when the region is defined in the shared credentials file under the defined profile |
Either this should be relabeled as a bug, or the documentation needs to be updated to indicate the implemented functionality. Documentation states shared credentials can be used to determine the default region:
Unfortunately, the region config is actually ignored. |
The documentation here probably could use some revamping to very clearly define the various pieces and ordering that go into authentication and region selection since both are pretty complex topics. I believe there is a distinction between what AWS refers to as "shared credentials" (
Does setting the |
@bflad , here's a recent test from cmd:
It appears as though the environment variable is ignored by the provider. |
I'm guessing this provider definition code rules out the possibility of defaulting to the region configured in the SDK. It's a required field. |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This issue was originally opened by @BGnoinski as hashicorp/terraform#13579. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
terraform -v
Terraform v0.9.2
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
If you have
[default]
region=ca-central-1
set in ~/.aws/config the provider "aws" should use it if none set in the terraform config.
Actual Behavior
provider "aws" uses aws_access_key_id= and aws_secret_access_key= from ~/.aws/credentials but ignores ~/.aws/config .
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Important Factoids
provider "aws" will respect environment variable AWS_DEFAULT_REGION= if set
AWS_DEFAULT_REGION=ca-central-1 terraform plan
The text was updated successfully, but these errors were encountered: