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

Feature/multiple roles in config #4830

Closed

Conversation

dsteinmo
Copy link

Changes proposed in this pull request:

  • Allow multiple assume_role() blocks in provider configuration. This change allows these roles to be assumed one after the other until the last role in the list is reached (order matters).

Motivating use case: We have a user account that has access to assume a role within our organization's root account with permissions delegated to create org accounts and to assume the newly created admin role in new accounts, OrganizationAccountAccessRole. However, without first making this change to terraform-provider-aws, we were unable to double-hop from the user account's keys, to the account-creation role (this part works already), to the OrganizationAccountAccessRole in the new account (this change enables this, plus any number of additional layers).

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAvailabilityZones'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSAvailabilityZones -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSAvailabilityZones_basic
--- PASS: TestAccAWSAvailabilityZones_basic (12.93s)
=== RUN   TestAccAWSAvailabilityZones_stateFilter
--- PASS: TestAccAWSAvailabilityZones_stateFilter (12.47s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       25.440s

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jun 13, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. labels Jun 13, 2018
@aeschright aeschright requested a review from a team June 25, 2019 21:30
@aeschright aeschright self-assigned this Oct 21, 2019
@aeschright
Copy link
Contributor

Hi @dsteinmo! We released an update to how the config files are handled that now allows the roles to be correctly chained (using source_profile). Does that resolve your use case? You can see the details of what was addressed here: hashicorp/aws-sdk-go-base#4

@dsteinmo
Copy link
Author

Looks good @aeschright! We can close off this PR for the record.

@dsteinmo dsteinmo closed this Oct 22, 2019
@ghost
Copy link

ghost commented Mar 29, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants