Skip to content

Commit

Permalink
Merge 8d20157 into 9842120
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanpm committed Mar 22, 2022
2 parents 9842120 + 8d20157 commit 4af044d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions exodus_lambda/functions/origin_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

CONF_FILE = os.environ.get("EXODUS_LAMBDA_CONF_FILE") or "lambda_config.json"

# Endpoint for AWS services.
# Normally, should be None.
# You might want to try e.g. "https://localhost:3377" if you want to test
# this code against localstack.
ENDPOINT_URL = os.environ.get("EXODUS_AWS_ENDPOINT_URL") or None


class OriginRequest(LambdaBase):
def __init__(self, conf_file=CONF_FILE):
Expand All @@ -29,15 +35,21 @@ def __init__(self, conf_file=CONF_FILE):
@property
def db_client(self):
if not self._db_client:
self._db_client = boto3.client("dynamodb", region_name=self.region)
self._db_client = boto3.client(
"dynamodb",
region_name=self.region,
endpoint_url=ENDPOINT_URL,
)

return self._db_client

@property
def sm_client(self):
if not self._sm_client:
self._sm_client = boto3.client(
"secretsmanager", region_name=self.region
"secretsmanager",
region_name=self.region,
endpoint_url=ENDPOINT_URL,
)

return self._sm_client
Expand Down

0 comments on commit 4af044d

Please sign in to comment.