Browse Source

add shared config state to session

By adding this flag to the session, we force the AWS Go SDK to read
the ~/.aws/config file. By default, the Go SDK doesn't read this file
which is often not what we or customers expect. Many customers store
their assume role based prfoiles in the .aws/config file rather than
the .aws/credentials file.

(This is what the AWS CLI does, by default - but that's because this
parameter is enabled by default in the python SDK).

Signed-off-by: Nicolas De Loof <[email protected]>
David Killmon 5 years ago
parent
commit
0df99075cc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ecs/pkg/amazon/backend/backend.go

+ 2 - 1
ecs/pkg/amazon/backend/backend.go

@@ -8,7 +8,8 @@ import (
 
 func NewBackend(profile string, region string) (*Backend, error) {
 	sess, err := session.NewSessionWithOptions(session.Options{
-		Profile: profile,
+		Profile:           profile,
+		SharedConfigState: session.SharedConfigEnable,
 		Config: aws.Config{
 			Region: aws.String(region),
 		},