Serverless-application-model: Unable to deploy API with inline swagger

Created on 18 Feb 2017  路  10Comments  路  Source: aws/serverless-application-model

Hi there,

When trying to deploy API with inline swagger using 'examples/2016-10-31/inline_swagger/template.yaml' getting following error:

FAILED - Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyApi] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both

DefinitionUri is not specified in template. Looks like a bug.

Thanks,
Andriy

Most helpful comment

I've just added pip install --upgrade awscli as the first step in the install phase. Worked like a charm!

All 10 comments

It looks like running aws cloudformation package will add DefinitionUri: s3://... to the template file, thus preventing it from deploying. I have tested this via CodeBuild.

You're right @elbil. Issue is with 'aws cloudformation package'.

As a workaround I am using sed -i '/DefinitionUri/d' <sam-packaged-template> before initiating aws cloudformation deploy.

I hope this issue will be resolved soon.

this is working in aws-cli/1.11.63

Think this issue can be closed.

I agree

I'm guessing the version of aws cli included in the aws/codebuild/nodejs:4.3.2 CodeBuild image is older than this because I'm running into this same problem during a build. Not even sure who I would contact about that.

I've just added pip install --upgrade awscli as the first step in the install phase. Worked like a charm!

Even the aws/codebuild/nodejs:7.0.0 image has aws 1.11.25 installed. 馃槥 Is there no chance of getting that upgraded, or do we have to add pip install --upgrade awscli to our install phase?

I think it's always going to lag behind, so if you would like to use the latest features it doesn't hurt to install it every time.

Was this page helpful?
0 / 5 - 0 ratings