Skip to content

Commit 38caaeb

Browse files
authored
fix: explicitly lookup AWS_ENDPOINT_URL_LAMBDA while using preview lambda model (#22)
1 parent e19e978 commit 38caaeb

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/aws_durable_execution_sdk_python/lambda_service.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,19 @@ def initialize_local_runner_client() -> LambdaClient:
862862
@staticmethod
863863
def initialize_from_env() -> LambdaClient:
864864
LambdaClient.load_preview_botocore_models()
865-
client = boto3.client(
866-
"lambdainternal",
867-
)
868865

869-
logger.debug("Initialized lambda client")
866+
"""
867+
TODO - we can remove this when were using the actual lambda client,
868+
but we need this with the preview model because boto won't match against lambdainternal.
869+
"""
870+
endpoint_url = os.getenv("AWS_ENDPOINT_URL_LAMBDA", None)
871+
if not endpoint_url:
872+
client = boto3.client(
873+
"lambdainternal",
874+
)
875+
else:
876+
client = boto3.client("lambdainternal", endpoint_url=endpoint_url)
877+
870878
return LambdaClient(client=client)
871879

872880
def checkpoint(

0 commit comments

Comments
 (0)