interface WebSocketIntegrationProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.WebSocketIntegrationProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#WebSocketIntegrationProps |
![]() | software.amazon.awscdk.services.apigatewayv2.WebSocketIntegrationProps |
![]() | aws_cdk.aws_apigatewayv2.WebSocketIntegrationProps |
![]() | aws-cdk-lib » aws_apigatewayv2 » WebSocketIntegrationProps |
The integration properties.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
declare const role: iam.Role;
declare const webSocketApi: apigatewayv2.WebSocketApi;
const webSocketIntegrationProps: apigatewayv2.WebSocketIntegrationProps = {
integrationType: apigatewayv2.WebSocketIntegrationType.AWS_PROXY,
integrationUri: 'integrationUri',
webSocketApi: webSocketApi,
// the properties below are optional
contentHandling: apigatewayv2.ContentHandling.CONVERT_TO_BINARY,
credentialsRole: role,
integrationMethod: 'integrationMethod',
passthroughBehavior: apigatewayv2.PassthroughBehavior.WHEN_NO_MATCH,
requestParameters: {
requestParametersKey: 'requestParameters',
},
requestTemplates: {
requestTemplatesKey: 'requestTemplates',
},
templateSelectionExpression: 'templateSelectionExpression',
timeout: cdk.Duration.minutes(30),
};
Properties
Name | Type | Description |
---|---|---|
integration | Web | Integration type. |
integration | string | Integration URI. |
web | IWeb | The WebSocket API to which this integration should be bound. |
content | Content | Specifies how to handle response payload content type conversions. |
credentials | IRole | Specifies the IAM role required for the integration. |
integration | string | Specifies the integration's HTTP method type. |
passthrough | Passthrough | Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. |
request | { [string]: string } | The request parameters that API Gateway sends with the backend request. |
request | { [string]: string } | A map of Apache Velocity templates that are applied on the request payload. |
template | string | The template selection expression for the integration. |
timeout? | Duration | The maximum amount of time an integration will run before it returns without a response. |
integrationType
Type:
Web
Integration type.
integrationUri
Type:
string
Integration URI.
webSocketApi
Type:
IWeb
The WebSocket API to which this integration should be bound.
contentHandling?
Type:
Content
(optional, default: The response payload will be passed through from the integration response to
the route response or method response without modification.)
Specifies how to handle response payload content type conversions.
credentialsRole?
Type:
IRole
(optional, default: No IAM role required.)
Specifies the IAM role required for the integration.
integrationMethod?
Type:
string
(optional, default: No HTTP method required.)
Specifies the integration's HTTP method type.
passthroughBehavior?
Type:
Passthrough
(optional, default: No passthrough behavior required.)
Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource.
There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.
requestParameters?
Type:
{ [string]: string }
(optional, default: No request parameters required.)
The request parameters that API Gateway sends with the backend request.
Specify request parameters as key-value pairs (string-to-string mappings), with a destination as the key and a source as the value.
requestTemplates?
Type:
{ [string]: string }
(optional, default: No request templates required.)
A map of Apache Velocity templates that are applied on the request payload.
{ "application/json": "{ \"statusCode\": 200 }" }
templateSelectionExpression?
Type:
string
(optional, default: No template selection expression required.)
The template selection expression for the integration.
timeout?
Type:
Duration
(optional, default: Duration.seconds(29))
The maximum amount of time an integration will run before it returns without a response.
Must be between 50 milliseconds and 29 seconds.