serverless-application-model: Cannot add multiple reference variables to AWS::Serverless::Api

When adding a AWS::Serverless::Api specifying multiple reference variables causes the message “Number of errors found: 1. Resource with id [TestUploadtestStage] is invalid. Type of property ‘Variables’ is invalid.” when deploying with “aws cloudformation deploy”. I can add either of the variables but cannot add both

  TestUpload:
     Type: AWS::Serverless::Api
     Properties:
        StageName: test
        DefinitionUri: swagger.json
        Variables:
          DeleteFunctionArn: !Ref DeleteFunction
          PutFunctionArn: !Ref PutFunction

Have I just got the syntax incorrect?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (7 by maintainers)

Commits related to this issue

Most upvoted comments

This is a bug in the transform, which fails when validating the structure of Variables property. We are working on fixing it.

At the moment, quickest way to validate is to call aws cloudformation create-change-set on the SAM template. This will trigger SAM -> CloudFormation translation that does syntactical validation. If you have a bug your resource definition, like a bad permission configuration, you have to deploy to get it validated.

I understand this isn’t the easiest approach, but it is the quickest at the moment. I am planning on writing a DEBUGGING guide to share this knowledge

No concrete ETA yet. It is in the order of a few days. Will reply back once it done

Sorry to keep you folks waiting

Yeah, early next week we should have this fixed

This should be fixed now. Can you verify it works?