interface HttpSqsIntegrationProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AwsApigatewayv2Integrations.HttpSqsIntegrationProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2integrations#HttpSqsIntegrationProps |
![]() | software.amazon.awscdk.aws_apigatewayv2_integrations.HttpSqsIntegrationProps |
![]() | aws_cdk.aws_apigatewayv2_integrations.HttpSqsIntegrationProps |
![]() | aws-cdk-lib » aws_apigatewayv2_integrations » HttpSqsIntegrationProps |
Properties to initialize HttpSqsIntegration
.
Example
import * as sqs from 'aws-cdk-lib/aws-sqs';
import { HttpSqsIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const queue: sqs.IQueue;
declare const httpApi: apigwv2.HttpApi;
// default integration (send message)
httpApi.addRoutes({
path: '/default',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpSqsIntegration('defaultIntegration', {
queue,
}),
});
// send message integration
httpApi.addRoutes({
path: '/send-message',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpSqsIntegration('sendMessageIntegration', {
queue,
subtype: apigwv2.HttpIntegrationSubtype.SQS_SEND_MESSAGE,
}),
});
// receive message integration
httpApi.addRoutes({
path: '/receive-message',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpSqsIntegration('receiveMessageIntegration', {
queue,
subtype: apigwv2.HttpIntegrationSubtype.SQS_RECEIVE_MESSAGE,
}),
});
// delete message integration
httpApi.addRoutes({
path: '/delete-message',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpSqsIntegration('deleteMessageIntegration', {
queue,
subtype: apigwv2.HttpIntegrationSubtype.SQS_DELETE_MESSAGE,
}),
});
// purge queue integration
httpApi.addRoutes({
path: '/purge-queue',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpSqsIntegration('purgeQueueIntegration', {
queue,
subtype: apigwv2.HttpIntegrationSubtype.SQS_PURGE_QUEUE,
}),
});
Properties
Name | Type | Description |
---|---|---|
queue | IQueue | SQS queue that Integrates with API Gateway. |
parameter | Parameter | Specifies how to transform HTTP requests before sending them to the backend. |
subtype? | Http | The subtype of the HTTP integration. |
queue
Type:
IQueue
SQS queue that Integrates with API Gateway.
parameterMapping?
Type:
Parameter
(optional, default: specify QueueUrl
. Additionally, set MessageBody
to $request.body.MessageBody
for SQS_SEND_MESSAGE
subtype
and set ReceiptHandle
to $request.body.ReceiptHandle
for SQS_DELETE_MESSAGE
subtype.)
Specifies how to transform HTTP requests before sending them to the backend.
subtype?
Type:
Http
(optional, default: HttpIntegrationSubtype.SQS_SEND_MESSAGE)
The subtype of the HTTP integration.
Only subtypes starting with SQS_ can be specified.