Unable to deploy API with inline swagger -- Either 'DefinitionUri' or 'DefinitionBody' property is required
Inline Swagger template would not deploy with the below error. I have confirmed that the "DefinitionBody" is present in the output template for deploy.
Resources: StockQuoteApi: Properties: DefinitionBody: StageName: dev Type: AWS::Serverless::Api Transform: AWS::Serverless-2016-10-31 basePath: /dev definitions:
aws cloudformation deploy --template-file inlineswagger-template-output-v2.yaml --stack-name SAM-inlineswagger-api-v2 --capabilities CAPABILITY_IAM --profile saml Waiting for changeset to be created..
Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [StockQuoteApi] is invalid. Either 'DefinitionUri' or 'DefinitionBody' property is required
I experienced the same issue today.
This is the same as https://github.com/awslabs/serverless-application-model/issues/93
It was a bug in awscli and it seems to be fixed now in the latest version. https://github.com/aws/aws-cli/blob/develop/CHANGELOG.rst Upgrade your awscli to 1.11.54
thanks @vasylk. I did update CLI and the issue went away.