From 90b12f13867562702a405278fda87510ee136374 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 28 Apr 2022 22:29:51 +0300 Subject: [PATCH] Add AWS_DYNAMODB_REGION Environment variable (#15054) Added AWS_DYNAMODB_REGION env --- changelog/15054.txt | 3 +++ physical/dynamodb/dynamodb.go | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 changelog/15054.txt diff --git a/changelog/15054.txt b/changelog/15054.txt new file mode 100644 index 000000000..8d4a82738 --- /dev/null +++ b/changelog/15054.txt @@ -0,0 +1,3 @@ +```release-note:feature +storage/dynamodb: Added `AWS_DYNAMODB_REGION` environment variable. +``` diff --git a/physical/dynamodb/dynamodb.go b/physical/dynamodb/dynamodb.go index e3e59ad20..18c2bbf50 100644 --- a/physical/dynamodb/dynamodb.go +++ b/physical/dynamodb/dynamodb.go @@ -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 + } } } }