I'm trying to include an OpenApi specification into my AWS::Serverless::Api
DefinitionBody
like so:
MyApi:
Type: "AWS::Serverless::Api"
Properties:
StageName: 'dev'
Domain:
DomainName: 'mydomain.com'
CertificateArn: 'my-arn'
EndpointConfiguration: REGIONAL
Route53:
HostedZoneId: 'HOSTEDZONEID'
BasePath:
- /api
DefinitionBody:
'Fn::Transform':
Name: 'AWS::Include'
Parameters:
Location: !Sub 'open-api.yml'
I used Fn:Transform
to ensure that my shorthand notation is evaluated. I'm using some AWS API Gateway extensions in my open-api.yml
like below:
...
x-amazon-apigateway-integration:
uri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${FunctionName}/invocations'
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_templates"
httpMethod: "GET"
type: "aws_proxy"
When I run sam deploy --debug
I get the following error:
Transform AWS::Include failed with: The specified S3 object's content should be valid Yaml/JSON