Skip to content

Commit

Permalink
Merge pull request #18 from koooge/mfa_profile
Browse files Browse the repository at this point in the history
feat: Support assuming a role with MFA token
  • Loading branch information
tsub committed Oct 23, 2019
2 parents e5cb48f + b4994ec commit 6a92c1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/aws_config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
)

Expand All @@ -12,8 +13,9 @@ type AWSParams struct {
// NewAWSParams creates a new AWSParams object
func NewAWSParams(awsProfile string) (*AWSParams, error) {
sess := session.Must(session.NewSessionWithOptions(session.Options{
Profile: awsProfile,
SharedConfigState: session.SharedConfigEnable,
Profile: awsProfile,
SharedConfigState: session.SharedConfigEnable,
AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
}))

return &AWSParams{
Expand Down

0 comments on commit 6a92c1a

Please sign in to comment.