Skip to content

Commit

Permalink
state/remote/s3: Fix Bug with Assume Role for Federated IAM Account (#…
Browse files Browse the repository at this point in the history
…10067)

* Enable remote s3 state support for assume role

- provide role_arn in backend config to enable assume role

Fixes #8739

* Check for errors after obtaining credentials
  • Loading branch information
darend authored and stack72 committed Feb 9, 2017
1 parent 00702da commit 8fde5bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions state/remote/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func s3Factory(conf map[string]string) (Client, error) {
Token: conf["token"],
Profile: conf["profile"],
CredsFilename: conf["shared_credentials_file"],
AssumeRoleARN: conf["role_arn"],
})
if err != nil {
return nil, err
}

// Call Get to check for credential provider. If nothing found, we'll get an
// error, and we can present it nicely to the user
_, err = creds.Get()
Expand Down
1 change: 1 addition & 0 deletions website/source/docs/state/remote/s3.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ The following configuration options or environment variables are supported:
`~/.aws/credentials` will be used.
* `token` - (Optional) Use this to set an MFA token. It can also be
sourced from the `AWS_SESSION_TOKEN` environment variable.
* `role_arn` - (Optional) The role to be assumed

0 comments on commit 8fde5bc

Please sign in to comment.