Skip to main content

integration_responses

Creates, updates, deletes, gets or lists an integration_responses resource.

Overview

Nameintegration_responses
TypeResource
Idaws.apigateway.integration_responses

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
content_handlingstringSpecifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors: If this property is not defined, the response payload will be passed through from the integration response to the method response without modification. (CONVERT_TO_BINARY, CONVERT_TO_TEXT)
response_parametersobjectA key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where name is a valid and unique response header name and JSON-expression is a valid JSON expression without the $ prefix.
response_templatesobjectSpecifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
selection_patternstringSpecifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+ regex to match error response. However, make sure that the error response does not contain any newline (\n) character in such cases. If the back end is an Lambda function, the Lambda function error header is matched. For all other HTTP and Amazon Web Services back ends, the HTTP status code is matched.
status_codestringThe status code. (pattern: <code>[1-5]\d\d</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_integration_responseselectrestapi_id, resource_id, http_method, status_code, regionRepresents a get integration response.
update_integration_responseupdaterestapi_id, resource_id, http_method, status_code, regionRepresents an update integration response.
put_integration_responsereplacerestapi_id, resource_id, http_method, status_code, regionRepresents a put integration.
delete_integration_responsedeleterestapi_id, resource_id, http_method, status_code, regionRepresents a delete integration response.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
http_methodstringSpecifies a delete integration response request's HTTP method.
regionstringAWS region (default: us-east-1)
resource_idstringSpecifies a delete integration response request's resource identifier.
restapi_idstringThe string identifier of the associated RestApi.
status_codestringSpecifies a delete integration response request's status code.

SELECT examples

Represents a get integration response.

SELECT
content_handling,
response_parameters,
response_templates,
selection_pattern,
status_code
FROM aws.apigateway.integration_responses
WHERE restapi_id = '{{ restapi_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
AND http_method = '{{ http_method }}' -- required
AND status_code = '{{ status_code }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Represents an update integration response.

UPDATE aws.apigateway.integration_responses
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND http_method = '{{ http_method }}' --required
AND status_code = '{{ status_code }}' --required
AND region = '{{ region }}' --required
RETURNING
content_handling,
response_parameters,
response_templates,
selection_pattern,
status_code;

REPLACE examples

Represents a put integration.

REPLACE aws.apigateway.integration_responses
SET
selectionPattern = '{{ selectionPattern }}',
responseParameters = '{{ responseParameters }}',
responseTemplates = '{{ responseTemplates }}',
contentHandling = '{{ contentHandling }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND http_method = '{{ http_method }}' --required
AND status_code = '{{ status_code }}' --required
AND region = '{{ region }}' --required
RETURNING
content_handling,
response_parameters,
response_templates,
selection_pattern,
status_code;

DELETE examples

Represents a delete integration response.

DELETE FROM aws.apigateway.integration_responses
WHERE restapi_id = '{{ restapi_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND http_method = '{{ http_method }}' --required
AND status_code = '{{ status_code }}' --required
AND region = '{{ region }}' --required
;