From cc849f65ce7436a00481dc31d5c59ad5f63d5646 Mon Sep 17 00:00:00 2001 From: Aurelien PERRIER Date: Fri, 29 Jun 2018 17:46:04 +0200 Subject: [PATCH] Adding support MFA (assumerole) --- blade/blade.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blade/blade.go b/blade/blade.go index b346bce..e733e02 100644 --- a/blade/blade.go +++ b/blade/blade.go @@ -9,6 +9,7 @@ import ( "github.com/TylerBrock/colorjson" "github.com/TylerBrock/saw/config" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/fatih/color" @@ -34,8 +35,9 @@ func NewBlade( } awsSessionOpts := session.Options{ - Config: awsCfg, - SharedConfigState: session.SharedConfigEnable, + Config: awsCfg, + AssumeRoleTokenProvider: stscreds.StdinTokenProvider, + SharedConfigState: session.SharedConfigEnable, } if awsConfig.Profile != "" {