diff --git a/backends/dynamodb/client.go b/backends/dynamodb/client.go index 9509d2d52..316e0d0a6 100644 --- a/backends/dynamodb/client.go +++ b/backends/dynamodb/client.go @@ -21,9 +21,19 @@ type Client struct { // It returns an error if the connection cannot be made or the table does not exist. func NewDynamoDBClient(table string) (*Client, error) { var c *aws.Config + + var endpoint = "" if os.Getenv("DYNAMODB_LOCAL") != "" { log.Debug("DYNAMODB_LOCAL is set") - endpoint := "http://localhost:8000" + endpoint = "http://localhost:8000" + } + if os.Getenv("DYNAMODB_LOCAL_ENDPOINT") != "" { + log.Debug("DYNAMODB_LOCAL_ENDPOINT is set") + endpoint = os.Getenv("DYNAMODB_LOCAL_ENDPOINT") + } + + if endpoint != "" { + log.Debug("dynamodb endpoint: %s", endpoint) c = &aws.Config{ Endpoint: &endpoint, }