# QueueProps

Properties for creating a new Queue.

Extends: QueueProps
Used as props by: Queue

- Source: [`aws-sqs/lib/queue.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-sqs/lib/queue.ts#L19)
- Type last changed: v2.214.0 · 2 Sep 2025

## Example

```ts
const topic = new sns.Topic(this, 'Topic');
const dlQueue = new sqs.Queue(this, 'DeadLetterQueue', {
  queueName: 'MySubscription_DLQ',
  retentionPeriod: Duration.days(14),
});

new sns.Subscription(this, 'Subscription', {
  endpoint: 'endpoint',
  protocol: sns.SubscriptionProtocol.LAMBDA,
  topic,
  deadLetterQueue: dlQueue,
});
```

## Properties

- `contentBasedDeduplication`: boolean = false — Specifies whether to enable content-based deduplication.

  During the deduplication interval (5 minutes), Amazon SQS treats
  messages that are sent with identical content (excluding attributes) as
  duplicates and delivers only one copy of the message.

  If you don't enable content-based deduplication and you want to deduplicate
  messages, provide an explicit deduplication ID in your SendMessage() call.

  (Only applies to FIFO queues.)

- `dataKeyReuse`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.minutes(5) — The length of time that Amazon SQS reuses a data key before calling KMS again.

  The value must be an integer between 60 (1 minute) and 86,400 (24
  hours). The default is 300 (5 minutes).

- `deadLetterQueue`: [DeadLetterQueue](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.DeadLetterQueue.html) — Send messages to this queue if they were unsuccessfully dequeued a number of times.

  **Default:** no dead-letter queue

- `deduplicationScope`: [DeduplicationScope](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.DeduplicationScope.html) = DeduplicationScope.QUEUE — For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.

  (Only applies to FIFO queues.)

- `deliveryDelay`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 0 — The time in seconds that the delivery of all messages in the queue is delayed.

  You can specify an integer value of 0 to 900 (15 minutes). The default
  value is 0.

- `encryption`: [QueueEncryption](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueEncryption.html) — Whether the contents of the queue are encrypted, and by what type of key.

  **Default:** SQS_MANAGED (SSE-SQS) for newly created queues

  Be aware that encryption is not available in all regions, please see the docs
  for current availability details.

- `encryptionMasterKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — External KMS key to use for queue encryption.

  **Default:** If encryption is set to KMS and not specified, a key will be created.

  Individual messages will be encrypted using data keys. The data keys in
  turn will be encrypted using this key, and reused for a maximum of
  `dataKeyReuseSecs` seconds.

  If the 'encryptionMasterKey' property is set, 'encryption' type will be
  implicitly set to "KMS".

- `enforceSSL`: boolean = false — Enforce encryption of data in transit.

- `fifo`: boolean — Whether this a first-in-first-out (FIFO) queue.

  **Default:** false, unless queueName ends in '.fifo' or 'contentBasedDeduplication' is true.

- `fifoThroughputLimit`: [FifoThroughputLimit](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.FifoThroughputLimit.html) = FifoThroughputLimit.PER_QUEUE — For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.

  (Only applies to FIFO queues.)

- `maxMessageSizeBytes`: number = 1MiB — The limit of how many bytes that a message can contain before Amazon SQS rejects it.

  You can specify an integer value from 1024 bytes (1 KiB) to 1048576 bytes
  (1 MiB). The default value is 1048576 (1 MiB).

- `queueName`: string — A name for the queue.

  **Default:** CloudFormation-generated name

  If specified and this is a FIFO queue, must end in the string '.fifo'.

- `receiveMessageWaitTime`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 0 — Default wait time for ReceiveMessage calls.

  Does not wait if set to 0, otherwise waits this amount of seconds
  by default for messages to arrive.

  For more information, see Amazon SQS Long Poll.

- `redriveAllowPolicy`: [RedriveAllowPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.RedriveAllowPolicy.html) — The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues.

  **Default:** All source queues can designate this queue as their dead-letter queue.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.DESTROY — Policy to apply when the queue is removed from the stack.

  Even though queues are technically stateful, their contents are transient and it
  is common to add and remove Queues while rearchitecting your application. The
  default is therefore `DESTROY`. Change it to `RETAIN` if the messages are so
  valuable that accidentally losing them would be unacceptable.

- `retentionPeriod`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.days(4) — The number of seconds that Amazon SQS retains a message.

  You can specify an integer value from 60 seconds (1 minute) to 1209600
  seconds (14 days). The default value is 345600 seconds (4 days).

- `visibilityTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(30) — Timeout of processing a single message.

  After dequeuing, the processor has this much time to handle the message
  and delete it from the queue before it becomes visible again for dequeueing
  by another processor.

  Values must be from 0 to 43200 seconds (12 hours). If you don't specify
  a value, AWS CloudFormation uses the default value of 30 seconds.
