QueueProps

class aws_cdk.aws_sqs.QueueProps(*, content_based_deduplication=None, data_key_reuse=None, dead_letter_queue=None, delivery_delay=None, encryption=None, encryption_master_key=None, fifo=None, max_message_size_bytes=None, queue_name=None, receive_message_wait_time=None, retention_period=None, visibility_timeout=None)

Bases: object

Properties for creating a new Queue.

Parameters
  • content_based_deduplication (Optional[bool]) – 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.) Default: false

  • data_key_reuse (Optional[Duration]) – 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). Default: Duration.minutes(5)

  • dead_letter_queue (Optional[DeadLetterQueue]) – Send messages to this queue if they were unsuccessfully dequeued a number of times. Default: no dead-letter queue

  • delivery_delay (Optional[Duration]) – 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. Default: 0

  • encryption (Optional[QueueEncryption]) – Whether the contents of the queue are encrypted, and by what type of key. Be aware that encryption is not available in all regions, please see the docs for current availability details. Default: Unencrypted

  • encryption_master_key (Optional[IKey]) – External KMS master key to use for queue encryption. 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”. Default: If encryption is set to KMS and not specified, a key will be created.

  • fifo (Optional[bool]) – Whether this a first-in-first-out (FIFO) queue. Default: false, unless queueName ends in ‘.fifo’ or ‘contentBasedDeduplication’ is true.

  • max_message_size_bytes (Union[int, float, None]) – 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 262144 bytes (256 KiB). The default value is 262144 (256 KiB). Default: 256KiB

  • queue_name (Optional[str]) – A name for the queue. If specified and this is a FIFO queue, must end in the string ‘.fifo’. Default: CloudFormation-generated name

  • receive_message_wait_time (Optional[Duration]) – 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. Default: 0

  • retention_period (Optional[Duration]) – 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). Default: Duration.days(4)

  • visibility_timeout (Optional[Duration]) – 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. Default: Duration.seconds(30)

Attributes

content_based_deduplication

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

Default

false

Return type

Optional[bool]

data_key_reuse

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

Default

Duration.minutes(5)

Return type

Optional[Duration]

dead_letter_queue

Send messages to this queue if they were unsuccessfully dequeued a number of times.

Default

no dead-letter queue

Return type

Optional[DeadLetterQueue]

delivery_delay

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.

Default

0

Return type

Optional[Duration]

encryption

Whether the contents of the queue are encrypted, and by what type of key.

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

Default

Unencrypted

Return type

Optional[QueueEncryption]

encryption_master_key

External KMS master key to use for queue encryption.

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

Default

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

Return type

Optional[IKey]

fifo

Whether this a first-in-first-out (FIFO) queue.

Default

false, unless queueName ends in ‘.fifo’ or ‘contentBasedDeduplication’ is true.

Return type

Optional[bool]

max_message_size_bytes

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 262144 bytes (256 KiB). The default value is 262144 (256 KiB).

Default

256KiB

Return type

Union[int, float, None]

queue_name

A name for the queue.

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

Default

CloudFormation-generated name

Return type

Optional[str]

receive_message_wait_time

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.

Default

0

Return type

Optional[Duration]

retention_period

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

Default

Duration.days(4)

Return type

Optional[Duration]

visibility_timeout

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.

Default

Duration.seconds(30)

Return type

Optional[Duration]