fix
This commit is contained in:
16
http-api/app/boto3clients.py
Normal file
16
http-api/app/boto3clients.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
|
||||
import boto3
|
||||
|
||||
DYNAMODB_ENDPOINT_URL: str | None = None
|
||||
|
||||
# Only when running `sam local start-api`
|
||||
if 'AWS_SAM_LOCAL' in os.environ:
|
||||
DYNAMODB_ENDPOINT_URL = 'http://host.docker.internal:8000'
|
||||
|
||||
# Only when running `pytest`
|
||||
if 'PYTEST_VERSION' in os.environ:
|
||||
DYNAMODB_ENDPOINT_URL = 'http://127.0.0.1:8000'
|
||||
|
||||
dynamodb_client = boto3.client('dynamodb', endpoint_url=DYNAMODB_ENDPOINT_URL)
|
||||
idp_client = boto3.client('cognito-idp')
|
||||
Reference in New Issue
Block a user