FAILED - Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [AWSIoTAPI] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both
The transform keeps on adding a DefinitionUri that points to garbage code even if DefinitionBody is already correctly defined inline.
I tried adding DefinitionUri : null, but it overwrites it again and points it to the lambda function folder
I've tried to find documentation on the package command and here on this github repo but I haven't been able to find anything definitive.
I ran into this exact same issue yesterday. Defined the swagger inline and the deployment failed with above error.
For now I reverted back to the default API without swagger or completely moving away from SAM again.
After submitting a support case with AWS, I found that this is actually not an issue with SAM at all. This is actually an issue that has already been patched in the AWS CLI, but for some reason the Codebuild image is still using an old, unpatched version. I solved this issue by updating the cli before running the package command. You can find the documentation here: https://github.com/awslabs/serverless-application-model/issues/93
@IDT-kcrook thanks for reporting this back. Now they just need to start replacing variables inside of the swagger file so we don't have to start writing weird scripted hacks to get
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${VpnStub.Arn}/invocations
working.
Most helpful comment
@IDT-kcrook thanks for reporting this back. Now they just need to start replacing variables inside of the swagger file so we don't have to start writing weird scripted hacks to get
working.