Reference to a external swagger api definition

  1. The Serverless Framework uses CloudFormation to handle deployments.
  2. CloudFormation supports Swagger (see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html)
  3. You can override the default CloudFormation template generated by the Serverless Framework (see https://serverless.com/framework/docs/providers/aws/guide/resources#override-aws-cloudformation-resource)

I would start by trying something like:

resources:
  Resources:
    ApiGatewayRestApi:
      Properties:
        Body:
          # Your swagger definition in YAML format goes here
4 Likes