Skip to content

Commit 3035a52

Browse files
authored
Bring back transforms after SAM removes them (#3417)
1 parent 31ac633 commit 3035a52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cfnlint/template/transforms/transform.py

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ def transform(self, cfn: Any) -> list[Match]:
5353
return matches
5454
cfn.template = template
5555

56+
if len(transform_type) > 1:
57+
# SAM will erase the entire Transform section
58+
# this sets it back with all transforms except SAM
59+
cfn.template["Transform"] = [
60+
t for t in transform_type if t != "AWS::Serverless-2016-10-31"
61+
]
62+
5663
LOGGER.info("Transformed template: \n%s", format_json_string(cfn.template))
5764
cfn.graph = Graph(cfn)
5865
cfn.conditions = Conditions(cfn)

0 commit comments

Comments
 (0)