1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

AWS Profiles - use credentials only if not null

This commit is contained in:
Mark Kelly
2019-01-25 12:53:34 +00:00
parent ac5ca1f05c
commit 068cb5a805

View File

@@ -187,7 +187,13 @@ func (key MasterKey) createSession() (*session.Session, error) {
if matches == nil {
return nil, fmt.Errorf("No valid ARN found in %q", key.Arn)
}
config := aws.Config{Region: aws.String(matches[1]), Credentials: credentials.NewSharedCredentials("", key.AwsProfile)}
config := aws.Config{Region: aws.String(matches[1])}
if key.AwsProfile != "" {
config.Credentials = credentials.NewSharedCredentials("", key.AwsProfile)
}
opts := session.Options{
Config: config,
AssumeRoleTokenProvider: stscreds.StdinTokenProvider,