Skip to content

Commit

Permalink
allow assuming role arn with shared config
Browse files Browse the repository at this point in the history
  • Loading branch information
mescam committed Nov 27, 2018
1 parent 58af94a commit e894767
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ func assumeProfile(profile string) (*credentials.Value, error) {

// assumeRole assumes the given role and returns the temporary STS credentials.
func assumeRole(role, mfa string, duration time.Duration) (*credentials.Value, error) {
sess := session.Must(session.NewSession())
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))

svc := sts.New(sess)

Expand Down

0 comments on commit e894767

Please sign in to comment.