From 9d1f22b8d7b26de4a564e37e8914fd0434589023 Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Wed, 26 Jun 2024 09:11:09 -0700 Subject: [PATCH] Bring back transforms after SAM removes them --- src/cfnlint/template/transforms/transform.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cfnlint/template/transforms/transform.py b/src/cfnlint/template/transforms/transform.py index 41b1060526..62d1f9b76e 100644 --- a/src/cfnlint/template/transforms/transform.py +++ b/src/cfnlint/template/transforms/transform.py @@ -53,6 +53,13 @@ def transform(self, cfn: Any) -> list[Match]: return matches cfn.template = template + if len(transform_type) > 1: + # SAM will erase the entire Transform section + # this sets it back with all transforms except SAM + cfn.template["Transform"] = [ + t for t in transform_type if t != "AWS::Serverless-2016-10-31" + ] + LOGGER.info("Transformed template: \n%s", format_json_string(cfn.template)) cfn.graph = Graph(cfn) cfn.conditions = Conditions(cfn)