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
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.
Yeah, see https://github.com/aws/aws-cli/pull/2451
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.
Most helpful comment
I've just added
pip install --upgrade awsclias the first step in theinstallphase. Worked like a charm!