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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user