diff --git a/src/aws_durable_execution_sdk_python/lambda_service.py b/src/aws_durable_execution_sdk_python/lambda_service.py index 21a692d..e3f540b 100644 --- a/src/aws_durable_execution_sdk_python/lambda_service.py +++ b/src/aws_durable_execution_sdk_python/lambda_service.py @@ -862,11 +862,19 @@ def initialize_local_runner_client() -> LambdaClient: @staticmethod def initialize_from_env() -> LambdaClient: LambdaClient.load_preview_botocore_models() - client = boto3.client( - "lambdainternal", - ) - logger.debug("Initialized lambda client") + """ + TODO - we can remove this when were using the actual lambda client, + but we need this with the preview model because boto won't match against lambdainternal. + """ + endpoint_url = os.getenv("AWS_ENDPOINT_URL_LAMBDA", None) + if not endpoint_url: + client = boto3.client( + "lambdainternal", + ) + else: + client = boto3.client("lambdainternal", endpoint_url=endpoint_url) + return LambdaClient(client=client) def checkpoint(