Skip to content

Commit

Permalink
Add support for MFA, related to issue #58 (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: Louis-Etienne Dorval <[email protected]>
  • Loading branch information
ledor473 and Louis-Etienne Dorval authored Oct 27, 2021
1 parent b619fc3 commit a0c0299
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aws/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
log "github.com/sirupsen/logrus"

Expand Down Expand Up @@ -48,9 +49,10 @@ func stsCredentialsSet() bool {

func newSession(profile string, region string, logger *log.Logger) *Session {
options := session.Options{
Config: *config.NewDefaultConfig(region),
Profile: profile,
SharedConfigState: session.SharedConfigEnable,
Config: *config.NewDefaultConfig(region),
Profile: profile,
SharedConfigState: session.SharedConfigEnable,
AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
}

session, err := session.NewSessionWithOptions(options)
Expand Down

0 comments on commit a0c0299

Please sign in to comment.