integration_responses
Creates, updates, deletes, gets or lists an integration_responses resource.
Overview
| Name | integration_responses |
| Type | Resource |
| Id | aws.apigatewayv2.integration_responses |
Fields
The following fields are returned by SELECT queries:
- get_integration_response
- get_integration_responses
| Name | Datatype | Description |
|---|---|---|
content_handling_strategy | string | Specifies how to handle response payload content type conversions. Supported only for WebSocket APIs. (CONVERT_TO_BINARY, CONVERT_TO_TEXT) |
integration_response_id | string | The identifier. |
integration_response_key | string | After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression's associated selection key type. |
response_parameters | object | A key-value map specifying response parameters that are passed to the method response from the backend. 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 | The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value. |
template_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
| Name | Datatype | Description |
|---|---|---|
content_handling_strategy | string | Specifies how to handle response payload content type conversions. Supported only for WebSocket APIs. (CONVERT_TO_BINARY, CONVERT_TO_TEXT) |
integration_response_id | string | The identifier. |
integration_response_key | string | After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression's associated selection key type. |
response_parameters | object | A key-value map specifying response parameters that are passed to the method response from the backend. 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 | The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value. |
template_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_integration_response | select | api_id, integration_id, integration_response_id, region | Gets an IntegrationResponses. | |
get_integration_responses | select | api_id, integration_id, region | maxResults, nextToken | Gets the IntegrationResponses for an Integration. |
create_integration_response | insert | api_id, integration_id, region, IntegrationResponseKey | Creates an IntegrationResponses. | |
update_integration_response | update | api_id, integration_id, integration_response_id, region | Updates an IntegrationResponses. | |
delete_integration_response | delete | api_id, integration_id, integration_response_id, region | Deletes an IntegrationResponses. |
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 |
|---|---|---|
api_id | string | The API identifier. |
integration_id | string | The integration ID. |
integration_response_id | string | The integration response ID. |
region | string | AWS region (default: us-east-1) |
maxResults | string | The maximum number of elements to be returned for this resource. |
nextToken | string | The next page of elements from this collection. Not valid for the last element of the collection. |
SELECT examples
- get_integration_response
- get_integration_responses
Gets an IntegrationResponses.
SELECT
content_handling_strategy,
integration_response_id,
integration_response_key,
response_parameters,
response_templates,
template_selection_expression
FROM aws.apigatewayv2.integration_responses
WHERE api_id = '{{ api_id }}' -- required
AND integration_id = '{{ integration_id }}' -- required
AND integration_response_id = '{{ integration_response_id }}' -- required
AND region = '{{ region }}' -- required
;
Gets the IntegrationResponses for an Integration.
SELECT
content_handling_strategy,
integration_response_id,
integration_response_key,
response_parameters,
response_templates,
template_selection_expression
FROM aws.apigatewayv2.integration_responses
WHERE api_id = '{{ api_id }}' -- required
AND integration_id = '{{ integration_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_integration_response
- Manifest
Creates an IntegrationResponses.
INSERT INTO aws.apigatewayv2.integration_responses (
ContentHandlingStrategy,
IntegrationResponseKey,
ResponseParameters,
ResponseTemplates,
TemplateSelectionExpression,
api_id,
integration_id,
region
)
SELECT
'{{ ContentHandlingStrategy }}',
'{{ IntegrationResponseKey }}' /* required */,
'{{ ResponseParameters }}',
'{{ ResponseTemplates }}',
'{{ TemplateSelectionExpression }}',
'{{ api_id }}',
'{{ integration_id }}',
'{{ region }}'
RETURNING
content_handling_strategy,
integration_response_id,
integration_response_key,
response_parameters,
response_templates,
template_selection_expression
;
# Description fields are for documentation purposes
- name: integration_responses
props:
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the integration_responses resource.
- name: integration_id
value: "{{ integration_id }}"
description: Required parameter for the integration_responses resource.
- name: region
value: "{{ region }}"
description: Required parameter for the integration_responses resource.
- name: ContentHandlingStrategy
value: "{{ ContentHandlingStrategy }}"
description: |
Specifies how to handle response payload content type conversions. Supported only for WebSocket APIs.
valid_values: ['CONVERT_TO_BINARY', 'CONVERT_TO_TEXT']
- name: IntegrationResponseKey
value: "{{ IntegrationResponseKey }}"
description: |
After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression's associated selection key type.
- name: ResponseParameters
value: "{{ ResponseParameters }}"
description: |
For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.{location}.{name} , where {location} is querystring, path, or header; and {name} must be a valid and unique method request parameter name. For HTTP API integrations with a specified integrationSubtype, request parameters are a key-value map specifying parameters that are passed to AWS_PROXY integrations. You can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see Working with AWS service integrations for HTTP APIs. For HTTP API integrations without a specified integrationSubtype request parameters are a key-value map specifying how to transform HTTP requests before sending them to the backend. The key should follow the pattern `<action>`:<header|querystring|path>.`<location>` where action can be append, overwrite or remove. For values, you can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see Transforming API requests and responses.
- name: ResponseTemplates
value: "{{ ResponseTemplates }}"
description: |
A mapping of identifier keys to templates. The value is an actual template script. The key is typically a SelectionKey which is chosen based on evaluating a selection expression.
- name: TemplateSelectionExpression
value: "{{ TemplateSelectionExpression }}"
description: |
An expression used to extract information at runtime. See Selection Expressions for more information.
UPDATE examples
- update_integration_response
Updates an IntegrationResponses.
UPDATE aws.apigatewayv2.integration_responses
SET
ContentHandlingStrategy = '{{ ContentHandlingStrategy }}',
IntegrationResponseKey = '{{ IntegrationResponseKey }}',
ResponseParameters = '{{ ResponseParameters }}',
ResponseTemplates = '{{ ResponseTemplates }}',
TemplateSelectionExpression = '{{ TemplateSelectionExpression }}'
WHERE
api_id = '{{ api_id }}' --required
AND integration_id = '{{ integration_id }}' --required
AND integration_response_id = '{{ integration_response_id }}' --required
AND region = '{{ region }}' --required
RETURNING
content_handling_strategy,
integration_response_id,
integration_response_key,
response_parameters,
response_templates,
template_selection_expression;
DELETE examples
- delete_integration_response
Deletes an IntegrationResponses.
DELETE FROM aws.apigatewayv2.integration_responses
WHERE api_id = '{{ api_id }}' --required
AND integration_id = '{{ integration_id }}' --required
AND integration_response_id = '{{ integration_response_id }}' --required
AND region = '{{ region }}' --required
;