Skip to content

Commit

Permalink
Make config key ARN instead of role name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Memisoglu committed Aug 20, 2019
1 parent 6a1a45f commit f923e2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/blockstorage/awsebs/awsebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
maxRetries = 10
// ConfigRegion represents region key required in the map "config"
ConfigRegion = "region"
// ConfigRole represents the key for the role which can be assumed.
// ConfigRole represents the key for the ARN of the role which can be assumed.
// It is optional.
ConfigRole = "role"
// AccessKeyID represents AWS Access key ID
Expand Down
5 changes: 2 additions & 3 deletions pkg/blockstorage/awsefs/awsefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (

// NewEFSProvider retuns a blockstorage provider for AWS EFS.
func NewEFSProvider(config map[string]string) (blockstorage.Provider, error) {
awsConfig, region, roleName, err := awsebs.GetConfig(config)
awsConfig, region, role, err := awsebs.GetConfig(config)
if err != nil {
return nil, errors.Wrap(err, "Failed to get configuration for EFS")
}
Expand All @@ -63,8 +63,7 @@ func NewEFSProvider(config map[string]string) (blockstorage.Provider, error) {
}
accountID := *user.Account
creds := awsConfig.Credentials
if roleName != "" {
role := roleARN(*user.Account, roleName)
if role != "" {
creds = stscreds.NewCredentials(s, role)
}
efsCli := awsefs.New(s, aws.NewConfig().WithRegion(region).WithCredentials(creds))
Expand Down

0 comments on commit f923e2e

Please sign in to comment.