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)