'API Gateway Canned Response From GET Request

I'm looking for a simple way to provide a message in a GET response of an API Gateway. I have a template that has several lambda integrations on the backend that are configured for various purposes - including an authorizer that validates requests upon requesting. I am looking to implement an additional GET method who's only responsibility is to return a JSON formatted response. Rather than have another lambda do this simple response, I would like to generate the response in the CFT. I just can't figure out what exactly is needed. I tried out the following AWS::ApiGateway::Method with an AWS::ApiGateway::Model but I don't think I am doing it correctly. I defer to the wizards of stackOverflow!

  GetMethodEndpoint:
    Type: "AWS::ApiGateway::Method"
    Properties:
      AuthorizationType: "NONE"
      OperationName: 'mock'
      ResourceId: !Ref APIResource
      RestApiId: !Ref apiGateway
      HttpMethod: "GET"
      MethodResponses:
        - ResponseModels: 
            application/json: !Ref ApiGatewayModel
          StatusCode: 200
      Integration:
        PassthroughBehavior: WHEN_NO_TEMPLATES
        TimeoutInMillis: 29000
        ConnectionType: 'INTERNET'
        Type: "MOCK"
        IntegrationResponses:
          - StatusCode: 200
            SelectionPattern: '2\d{2}'
            ResponseTemplates: 
              application/json: "{\"message\":{\"support_info\": \"This is a canned response that I want returned when the GET request is made.  It would be ideal for this to be nested json but...\}"

  ApiGatewayModel:
    Type: AWS::ApiGateway::Model
    Properties:
      ContentType: 'application/json'
      RestApiId: !Ref apiGateway
      Schema: {}


Solution 1:[1]

Defining API Gateway with Cloudformation is a nightmare. Based on experience, it's easier to prepare API Gateway resources, methods, integrations, responses, transformations with GUI and then export API definition to OpenAPI format.

You can than provide OpenAPI file content as Body property of AWS::ApiGateway::RestApi resource, or as S3 object location with BodyS3Location property of AWS::ApiGateway::RestApi

I think Swager is also supported.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tomasz Bre?