Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def generate_sam_template():
"Timeout": 60,
"MemorySize": 128,
"Environment": {
"Variables": {"DEX_ENDPOINT": {"Ref": "LambdaEndpoint"}}
"Variables": {"AWS_ENDPOINT_URL_LAMBDA": {"Ref": "LambdaEndpoint"}}
},
}
},
Expand Down Expand Up @@ -353,7 +353,9 @@ def deploy_function(example_name: str, function_name: str | None = None):
"Description": example_config["description"],
"Timeout": 60,
"MemorySize": 128,
# "Environment": {"Variables": {"AWS_ENDPOINT_URL_LAMBDA": config["lambda_endpoint"]}},
"Environment": {
"Variables": {"AWS_ENDPOINT_URL_LAMBDA": config["lambda_endpoint"]}
},
"DurableConfig": example_config["durableConfig"],
}

Expand Down
10 changes: 4 additions & 6 deletions src/aws_durable_execution_sdk_python_testing/web/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ def handle(self, parsed_route: Route, request: HTTPRequest) -> HTTPResponse: #
region_name = body.get("RegionName", "us-east-1")

if not endpoint_url:
return HTTPResponse.create_json(
400, {"error": "EndpointUrl is required"}
return self._handle_aws_exception(
InvalidParameterValueException("EndpointUrl is required")
)

# Update the invoker's Lambda endpoint
Expand All @@ -802,7 +802,5 @@ def handle(self, parsed_route: Route, request: HTTPRequest) -> HTTPResponse: #
{"message": "Lambda endpoint updated successfully"}
)

except (AttributeError, TypeError) as e:
return HTTPResponse.create_json(
500, {"error": f"Failed to update Lambda endpoint: {e!s}"}
)
except Exception as e: # noqa: BLE001
return self._handle_framework_exception(e)
3 changes: 2 additions & 1 deletion tests/web/handlers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,8 @@ def test_update_lambda_endpoint_handler_missing_endpoint_url():
response = handler.handle(update_route, request)

assert response.status_code == 400
assert response.body == {"error": "EndpointUrl is required"}
assert response.body["Type"] == "InvalidParameterValueException"
assert response.body["message"] == "EndpointUrl is required"


def test_update_lambda_endpoint_handler_default_region():
Expand Down