Skip to main content

integrations

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

Overview

Nameintegrations
TypeResource
Idaws.apigatewayv2.integrations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
api_gateway_managedbooleanSpecifies whether an integration is managed by API Gateway. If you created an API using using quick create, the resulting integration is managed by API Gateway. You can update a managed integration, but you can't delete it.
connection_idstringA string with a length between [1-1024].
connection_typestringRepresents a connection type. (INTERNET, VPC_LINK)
content_handling_strategystringSpecifies how to handle response payload content type conversions. Supported only for WebSocket APIs. (CONVERT_TO_BINARY, CONVERT_TO_TEXT)
credentials_arnstringRepresents an Amazon Resource Name (ARN).
descriptionstringA string with a length between [0-1024].
integration_idstringThe identifier.
integration_methodstringA string with a length between [1-64].
integration_response_selection_expressionstringAn expression used to extract information at runtime. See Selection Expressions for more information.
integration_subtypestringA string with a length between [1-128].
integration_typestringRepresents an API method integration type. (AWS, HTTP, MOCK, HTTP_PROXY, AWS_PROXY)
integration_uristringA string representation of a URI with a length between [1-2048].
passthrough_behaviorstringRepresents passthrough behavior for an integration response. Supported only for WebSocket APIs. (WHEN_NO_MATCH, NEVER, WHEN_NO_TEMPLATES)
payload_format_versionstringA string with a length between [1-64].
request_parametersobjectFor 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 backend integrations. The key should follow the pattern <action>:<header|querystring|path>.&lt;location&gt;. The 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.
request_templatesobjectRepresents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value. Supported only for WebSocket APIs.
response_parametersobjectSupported only for HTTP APIs. You use response parameters to transform the HTTP response from a backend integration before returning the response to clients. Specify a key-value map from a selection key to response parameters. The selection key must be a valid HTTP status code within the range of 200-599. Response parameters are a key-value map. The key must match pattern <action>:<header>.&lt;location&gt; or overwrite.statuscode. The action can be append, overwrite or remove. The value can be a static value, or map to response data, stage variables, or context variables that are evaluated at runtime. To learn more, see Transforming API requests and responses.
template_selection_expressionstringAn expression used to extract information at runtime. See Selection Expressions for more information.
timeout_in_millisintegerAn integer with a value between [50-30000].
tls_configobjectThe TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_integrationselectapi_id, integration_id, regionGets an Integration.
get_integrationsselectapi_id, regionmaxResults, nextTokenGets the Integrations for an API.
create_integrationinsertapi_id, region, IntegrationTypeCreates an Integration.
update_integrationupdateapi_id, integration_id, regionUpdates an Integration.
delete_integrationdeleteapi_id, integration_id, regionDeletes an Integration.

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
api_idstringThe API identifier.
integration_idstringThe integration ID.
regionstringAWS region (default: us-east-1)
maxResultsstringThe maximum number of elements to be returned for this resource.
nextTokenstringThe next page of elements from this collection. Not valid for the last element of the collection.

SELECT examples

Gets an Integration.

SELECT
api_gateway_managed,
connection_id,
connection_type,
content_handling_strategy,
credentials_arn,
description,
integration_id,
integration_method,
integration_response_selection_expression,
integration_subtype,
integration_type,
integration_uri,
passthrough_behavior,
payload_format_version,
request_parameters,
request_templates,
response_parameters,
template_selection_expression,
timeout_in_millis,
tls_config
FROM aws.apigatewayv2.integrations
WHERE api_id = '{{ api_id }}' -- required
AND integration_id = '{{ integration_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an Integration.

INSERT INTO aws.apigatewayv2.integrations (
ConnectionId,
ConnectionType,
ContentHandlingStrategy,
CredentialsArn,
Description,
IntegrationMethod,
IntegrationSubtype,
IntegrationType,
IntegrationUri,
PassthroughBehavior,
PayloadFormatVersion,
RequestParameters,
RequestTemplates,
ResponseParameters,
TemplateSelectionExpression,
TimeoutInMillis,
TlsConfig,
api_id,
region
)
SELECT
'{{ ConnectionId }}',
'{{ ConnectionType }}',
'{{ ContentHandlingStrategy }}',
'{{ CredentialsArn }}',
'{{ Description }}',
'{{ IntegrationMethod }}',
'{{ IntegrationSubtype }}',
'{{ IntegrationType }}' /* required */,
'{{ IntegrationUri }}',
'{{ PassthroughBehavior }}',
'{{ PayloadFormatVersion }}',
'{{ RequestParameters }}',
'{{ RequestTemplates }}',
'{{ ResponseParameters }}',
'{{ TemplateSelectionExpression }}',
{{ TimeoutInMillis }},
'{{ TlsConfig }}',
'{{ api_id }}',
'{{ region }}'
RETURNING
api_gateway_managed,
connection_id,
connection_type,
content_handling_strategy,
credentials_arn,
description,
integration_id,
integration_method,
integration_response_selection_expression,
integration_subtype,
integration_type,
integration_uri,
passthrough_behavior,
payload_format_version,
request_parameters,
request_templates,
response_parameters,
template_selection_expression,
timeout_in_millis,
tls_config
;

UPDATE examples

Updates an Integration.

UPDATE aws.apigatewayv2.integrations
SET
ConnectionId = '{{ ConnectionId }}',
ConnectionType = '{{ ConnectionType }}',
ContentHandlingStrategy = '{{ ContentHandlingStrategy }}',
CredentialsArn = '{{ CredentialsArn }}',
Description = '{{ Description }}',
IntegrationMethod = '{{ IntegrationMethod }}',
IntegrationSubtype = '{{ IntegrationSubtype }}',
IntegrationType = '{{ IntegrationType }}',
IntegrationUri = '{{ IntegrationUri }}',
PassthroughBehavior = '{{ PassthroughBehavior }}',
PayloadFormatVersion = '{{ PayloadFormatVersion }}',
RequestParameters = '{{ RequestParameters }}',
RequestTemplates = '{{ RequestTemplates }}',
ResponseParameters = '{{ ResponseParameters }}',
TemplateSelectionExpression = '{{ TemplateSelectionExpression }}',
TimeoutInMillis = {{ TimeoutInMillis }},
TlsConfig = '{{ TlsConfig }}'
WHERE
api_id = '{{ api_id }}' --required
AND integration_id = '{{ integration_id }}' --required
AND region = '{{ region }}' --required
RETURNING
api_gateway_managed,
connection_id,
connection_type,
content_handling_strategy,
credentials_arn,
description,
integration_id,
integration_method,
integration_response_selection_expression,
integration_subtype,
integration_type,
integration_uri,
passthrough_behavior,
payload_format_version,
request_parameters,
request_templates,
response_parameters,
template_selection_expression,
timeout_in_millis,
tls_config;

DELETE examples

Deletes an Integration.

DELETE FROM aws.apigatewayv2.integrations
WHERE api_id = '{{ api_id }}' --required
AND integration_id = '{{ integration_id }}' --required
AND region = '{{ region }}' --required
;