DEV Community

Takahiro Kudo
Takahiro Kudo

Posted on

AWS - Set static value to IntegrationResponses

Write the following in case setting the static value to Integration response in API Gateway.

SomeMethod:
  Type: AWS::ApiGateway::Method
  Properties:
    HttpMethod: POST
    ...
    Integration:
      Type: AWS
      IntegrationHttpMethod: POST
      ...
      IntegrationResponses:
        - StatusCode: 200
          SelectionPattern: "status:200"
          ResponseParameters:
            # OK
            method.response.header.X-STATIC-HEADER: "'1'"
            # NG
            method.response.header.X-STATIC-HEADER: 1
            # NG
            method.response.header.X-STATIC-HEADER: "1"

Enter fullscreen mode Exit fullscreen mode

Reference

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apitgateway-method-integration-integrationresponse.html#cfn-apigateway-method-integration-integrationresponse-responseparameters

Top comments (0)