Skip to content

Commit 934973d

Browse files
authored
AWS_PROFILE Env Var Support (#15)
* Added AWS_PROFLE and shared cred Following convention, if the command line arguments does not specify a profile, we check the AWS_PROFILE. The sdk session options is also initialised with SharedConfigEnable to support shared configurations from the (~/.aws/config). https://github.com/aws/aws-sdk-go#configuring-credentials * AWS_PROFILE and shared cred Following convention, if the command line arguments does not specify a profile, we check the AWS_PROFILE. The sdk session options is also initialised with SharedConfigEnable to support shared configurations from the (~/.aws/config). https://github.com/aws/aws-sdk-go#configuring-credentials * Removing AWS_PROFILE lookup in fav sharedConfigEnabled By setting up the sharedConfigState to enabled the SDK does take care of the AWS_PROFILE population: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#SharedConfigState * removing unused const AWS_PROFILE
1 parent 8c62f4f commit 934973d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func getOutputFn(outputFlag *string, currentFn selector.InstanceTypesOutputFn) s
270270
}
271271

272272
func getRegionAndProfileAWSSession(regionName *string, profileName *string) (*session.Session, error) {
273-
sessOpts := session.Options{}
273+
sessOpts := session.Options{SharedConfigState: session.SharedConfigEnable}
274274
if regionName != nil {
275275
sessOpts.Config.Region = regionName
276276
}

0 commit comments

Comments
 (0)