Skip to content

Commit

Permalink
Add AWS_DYNAMODB_REGION Environment variable (#15054)
Browse files Browse the repository at this point in the history
Added AWS_DYNAMODB_REGION env
  • Loading branch information
sergeylanzman committed Apr 28, 2022
1 parent 7089487 commit 0be45d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog/15054.txt
@@ -0,0 +1,3 @@
```release-note:feature
storage/dynamodb: Added `AWS_DYNAMODB_REGION` environment variable.
```
11 changes: 7 additions & 4 deletions physical/dynamodb/dynamodb.go
Expand Up @@ -163,13 +163,16 @@ 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_DEFAULT_REGION")
region = os.Getenv("AWS_REGION")
if region == "" {
region = conf["region"]
region = os.Getenv("AWS_DEFAULT_REGION")
if region == "" {
region = DefaultDynamoDBRegion
region = conf["region"]
if region == "" {
region = DefaultDynamoDBRegion
}
}
}
}
Expand Down

0 comments on commit 0be45d0

Please sign in to comment.