# HttpSqsIntegrationProps

Properties to initialize `HttpSqsIntegration`.

Extends: HttpSqsIntegrationProps
Used as props by: HttpSqsIntegration

- Source: [`aws-apigatewayv2-integrations/lib/http/sqs.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/http/sqs.ts#L11)
- Type last changed: v2.179.0 · 18 Feb 2025

## Example

```ts
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

- `parameterMapping`: [ParameterMapping](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.ParameterMapping.html) — Specifies how to transform HTTP requests before sending them to the backend.

  **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.

- `queue`: [IQueue](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.IQueue.html) (required) — SQS queue that Integrates with API Gateway.

- `subtype`: [HttpIntegrationSubtype](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpIntegrationSubtype.html) — The subtype of the HTTP integration.

  **Default:** HttpIntegrationSubtype.SQS_SEND_MESSAGE

  Only subtypes starting with SQS_ can be specified.
