integration_responses
Creates, updates, deletes, gets or lists an integration_responses resource.
Overview
| Name | integration_responses |
| Type | Resource |
| Id | aws.apigateway.integration_responses |
Fields
The following fields are returned by SELECT queries:
- get_integration_response
| Name | Datatype | Description |
|---|---|---|
content_handling | string | Specifies 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_parameters | object | A 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_templates | object | Specifies 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_pattern | string | Specifies 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_code | string | The status code. (pattern: <code>[1-5]\d\d</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_integration_response | select | restapi_id, resource_id, http_method, status_code, region | Represents a get integration response. | |
update_integration_response | update | restapi_id, resource_id, http_method, status_code, region | Represents an update integration response. | |
put_integration_response | replace | restapi_id, resource_id, http_method, status_code, region | Represents a put integration. | |
delete_integration_response | delete | restapi_id, resource_id, http_method, status_code, region | Represents 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.
| Name | Datatype | Description |
|---|---|---|
http_method | string | Specifies a delete integration response request's HTTP method. |
region | string | AWS region (default: us-east-1) |
resource_id | string | Specifies a delete integration response request's resource identifier. |
restapi_id | string | The string identifier of the associated RestApi. |
status_code | string | Specifies a delete integration response request's status code. |
SELECT examples
- get_integration_response
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
- update_integration_response
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
- put_integration_response
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
- delete_integration_response
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
;