# HttpSqsIntegration

The Sqs integration resource for HTTP API.

Extends: HttpRouteIntegration › HttpSqsIntegration

- Source: [`aws-apigatewayv2-integrations/lib/http/sqs.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/http/sqs.ts#L41)
- 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,
  }),
});
```

## Initializer

```ts
new HttpSqsIntegration(id: string, props: HttpSqsIntegrationProps)
```

## Methods

- `bind(options: HttpRouteIntegrationBindOptions): HttpRouteIntegrationConfig` — Bind this integration to the route.
