Add AWS_DYNAMODB_REGION Environment variable (#15054)

Added AWS_DYNAMODB_REGION env
This commit is contained in:
Sergey Lanzman 2022-04-28 22:29:51 +03:00 committed by GitHub
parent 0ef529b710
commit 90b12f1386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

3
changelog/15054.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:feature
storage/dynamodb: Added `AWS_DYNAMODB_REGION` environment variable.
```

View File

@ -163,7 +163,9 @@ func NewDynamoDBBackend(conf map[string]string, logger log.Logger) (physical.Bac
if endpoint == "" {
endpoint = conf["endpoint"]
}
region := os.Getenv("AWS_REGION")
region := os.Getenv("AWS_DYNAMODB_REGION")
if region == "" {
region = os.Getenv("AWS_REGION")
if region == "" {
region = os.Getenv("AWS_DEFAULT_REGION")
if region == "" {
@ -173,6 +175,7 @@ func NewDynamoDBBackend(conf map[string]string, logger log.Logger) (physical.Bac
}
}
}
}
dynamodbMaxRetryString := os.Getenv("AWS_DYNAMODB_MAX_RETRIES")
if dynamodbMaxRetryString == "" {