mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 00:33:28 -04:00
Region is required so error in awsutil if not set and set if empty in client code in logical/aws
This commit is contained in:
parent
56011c9443
commit
56cc74887f
2 changed files with 7 additions and 0 deletions
|
|
@ -30,6 +30,10 @@ func getRootConfig(s logical.Storage) (*aws.Config, error) {
|
|||
credConfig.Region = config.Region
|
||||
}
|
||||
|
||||
if credConfig.Region == "" {
|
||||
credConfig.Region = "us-east-1"
|
||||
}
|
||||
|
||||
creds, err := awsutil.GenerateCredentialChain(credConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ func GenerateCredentialChain(config *AWSCredentialsConfig) (*credentials.Credent
|
|||
if config == nil {
|
||||
return nil, fmt.Errorf("nil configuration provided")
|
||||
}
|
||||
if config.Region == "" {
|
||||
return nil, fmt.Errorf("region must be provided in credentials configuration")
|
||||
}
|
||||
|
||||
var providers []credentials.Provider
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue