AWS CloudFormation
User Guide (Version )

AWS::ApiGateway::Method IntegrationResponse

IntegrationResponse is a property of the Amazon API Gateway Method Integration property type that specifies the response that API Gateway sends after a method's backend finishes processing a request.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "ContentHandling" : String, "ResponseParameters" : {Key : Value, ...}, "ResponseTemplates" : {Key : Value, ...}, "SelectionPattern" : String, "StatusCode" : String }

YAML

ContentHandling: String ResponseParameters: Key : Value ResponseTemplates: Key : Value SelectionPattern: String StatusCode: String

Properties

ContentHandling

Specifies how to handle request payload content type conversions. Valid values are:

  • CONVERT_TO_BINARY: Converts a request payload from a base64-encoded string to a binary blob.

  • CONVERT_TO_TEXT: Converts a request payload from a binary blob to a base64-encoded string.

If this property isn't defined, the request payload is passed through from the method request to the integration request without modification.

Required: No

Type: String

Update requires: No interruption

ResponseParameters

The response parameters from the backend response that API Gateway sends to the method response. Specify response parameters as key-value pairs (string-to-string mappings).

Use the destination as the key and the source as the value:

  • The destination must be an existing response parameter in the MethodResponse property.

  • The source must be an existing method request parameter or a static value. You must enclose static values in single quotation marks and pre-encode these values based on the destination specified in the request.

For more information about templates, see API Gateway Mapping Template and Access Logging Variable Reference in the API Gateway Developer Guide.

Required: No

Type: Map of String

Update requires: No interruption

ResponseTemplates

The templates that are used to transform the integration response body. Specify templates as key-value pairs (string-to-string mappings), with a content type as the key and a template as the value. For more information, see API Gateway Mapping Template and Access Logging Variable Reference in the API Gateway Developer Guide.

Required: No

Type: Map of String

Update requires: No interruption

SelectionPattern

A regular expression that specifies which error strings or status codes from the backend map to the integration response.

Required: No

Type: String

Update requires: No interruption

StatusCode

The status code that API Gateway uses to map the integration response to a MethodResponse status code.

Required: Yes

Type: String

Update requires: No interruption

See Also

  • Method in the Amazon API Gateway REST API Reference

On this page: