Skip to content

Internal transform failure on bad Condition syntax #892

@jlhood

Description

@jlhood

Description:

Customer pinged me that deployment was failing with "FAILED - Transform AWS::Serverless-2016-10-31 failed with: Internal transform failure."

The issue was a syntax error in their template, but SAM should handle that case more gracefully and provide a helpful error message.

The syntax error was in the use of Condition support on SAM resources. Sample template that reproduces the issue:

"Conditions":
  "MyCondition":
    "Fn::Equals":
      - true
      - true

"Resources":
 "MyFunction":
    "Type": "AWS::Serverless::Function"
    "Condition":
      "Ref": "MyCondition"  # bad template syntax: don't need to Ref the condition name
    "Properties":
      ...
      "Events":
        "PostApi":
          "Type": "Api"
          "Properties":
            "Method": "POST"
            "Path": "/foo"

Steps to reproduce the issue:

  1. Try to deploy the sample template using SAM.

Observed result:
ChangeSet fails with “FAILED - Transform AWS::Serverless-2016-10-31 failed with: Internal transform failure.”

Expected result:
ChangeSet fails with more helpful error message from SAM translator.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions