Skip to content

Commit

Permalink
use old session name for new sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
felixb committed Dec 7, 2017
1 parent 64ebc45 commit 4465e90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ func ensureTargetProfile(sess *session.Session, targetProfile, targetRole *strin
svc := sts.New(sess)

userId := getCallerId(svc).Arn
roleSessionName := strings.Split(*userId, "/")[1]
parts := strings.Split(*userId, "/")
roleSessionName := parts[len(parts) -1]

cred := assumeRole(svc, targetRole, &roleSessionName, duration)
writeProfile(cred, targetProfile, sess.Config.Region)
Expand Down

0 comments on commit 4465e90

Please sign in to comment.