-
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
[bug] AWS provider is not loading role_arn from CLI config file under each profile #758
Comments
Hello, |
@ju2wheels did you ever find a workaround for this issue? I am attempting to import an existing Route53 hosted zone and receiving similar permission errors. |
@ju2wheels you can ignore my request. It turns out my issue was likely unrelated. While attempting to import an existing Route53 record, I mistakenly used the |
This bug still exists for me. I have not been able to figure out why but when we run Terraform in our docker container everything seems to work as expected. When I launch that same docker container as our main container in CircleCi then this bug presents itself. I have a workaround using the provider but its gets to messy given that the roles change based on CI running it or developers running it. provider "aws" {
region = "eu-west-1"
# profile = "${local.this_is_production ? "production" : "development" }"
# workaround for circle ci https://github.com/terraform-providers/terraform-provider-aws/issues/758
profile = "master"
assume_role {
role_arn = "${local.this_is_production ? "arn:aws:iam::000000000000:role/deployer" : "arn:aws:iam::111111111111:role/deployer" }"
}
}``` |
Hi @ju2wheels and others! This will be fixed in the next release with the upgrade to aws-sdk-go-base@0.4.0. Per the AWS docs, if you specify |
Closing as #10379 was merged previously and v2.32.0 has been released. 👍 |
This has been released in version 2.32.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
@aerostitch we just tested with
provider "aws" {
alias = "prod-us-west-2"
region = "us-west-2"
version = "= 2.33.0"
profile = "prod"
allowed_account_ids = ["123456789"]
}
|
Hey @scalp42! Can you refresh my memory on why you're pinging me here please? (I have a really bad memory so it might be legitimate or you might just have made a typo and meant @aeschright maybe?) |
I totally made a typo @aerostitch sorry about that. I can confirm it works now as I had an issue in the the aws config file as well 🎉 |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @ju2wheels as hashicorp/terraform#14356. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
0.9.4
Affected Resource(s)
Terraform Configuration Files
In combinartion with
~/.aws/config
:Expected Behavior
When I run my Terraform module with an empty AWS provider block, I expect that it will use the combination of environment variables and the AWS CLI configuration file profile without having to add an assume_role block with the role_arn property to the AWS provider
Running:
Actual Behavior
The Terraform AWS provider ignores the profile role specified in
~/.aws/config
and runs it using the AWS credentials for the profile only resulting in it being put in the wrong role.Steps to Reproduce
~/.aws/credentials
.The text was updated successfully, but these errors were encountered: