Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 46dfd8a

Browse files
committed
Lambda: Raise error when function added a capacity provider
1 parent 100783b commit 46dfd8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

localstack-core/localstack/services/lambda_/provider.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,19 @@ def update_function_configuration(
13621362
if new_mode:
13631363
replace_kwargs["tracing_config_mode"] = new_mode
13641364

1365+
if "CapacityProviderConfig" in request:
1366+
if latest_version.config.CapacityProviderConfig and not request[
1367+
"CapacityProviderConfig"
1368+
].get("LambdaManagedInstancesCapacityProviderConfig"):
1369+
raise ValidationException(
1370+
"1 validation error detected: Value null at 'capacityProviderConfig.lambdaManagedInstancesCapacityProviderConfig' failed to satisfy constraint: Member must not be null"
1371+
)
1372+
if not latest_version.config.CapacityProviderConfig:
1373+
raise InvalidParameterValueException(
1374+
"CapacityProviderConfig isn't supported for Lambda Default functions.",
1375+
Type="User",
1376+
)
1377+
13651378
new_latest_version = dataclasses.replace(
13661379
latest_version,
13671380
config=dataclasses.replace(

0 commit comments

Comments
 (0)