Skip to content

Commit 542955c

Browse files
committed
Also require capability for Fn::Transform usage
1 parent db4a388 commit 542955c

File tree

1 file changed

+4
-6
lines changed
  • localstack-core/localstack/services/cloudformation/v2

1 file changed

+4
-6
lines changed

localstack-core/localstack/services/cloudformation/v2/provider.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,8 @@ def create_stack(self, context: RequestContext, request: CreateStackInput) -> Cr
477477
template_body = api_utils.extract_template_body(request)
478478
structured_template = template_preparer.parse_template(template_body)
479479

480-
if (
481-
"CAPABILITY_AUTO_EXPAND" not in request.get("Capabilities", [])
482-
and "Transform" in structured_template.keys()
480+
if "CAPABILITY_AUTO_EXPAND" not in request.get("Capabilities", []) and (
481+
"Transform" in structured_template.keys() or "Fn::Transform" in template_body
483482
):
484483
raise InsufficientCapabilitiesException(
485484
"Requires capabilities : [CAPABILITY_AUTO_EXPAND]"
@@ -689,9 +688,8 @@ def update_stack(
689688
template_body = api_utils.extract_template_body(request)
690689
structured_template = template_preparer.parse_template(template_body)
691690

692-
if (
693-
"CAPABILITY_AUTO_EXPAND" not in request.get("Capabilities", [])
694-
and "Transform" in structured_template.keys()
691+
if "CAPABILITY_AUTO_EXPAND" not in request.get("Capabilities", []) and (
692+
"Transform" in structured_template.keys() or "Fn::Transform" in template_body
695693
):
696694
raise InsufficientCapabilitiesException(
697695
"Requires capabilities : [CAPABILITY_AUTO_EXPAND]"

0 commit comments

Comments
 (0)