QueueProps Struct
Properties for creating a new Queue.
Example
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
contentBasedDeduplicationoptionalbooleancontent_based_deduplicationoptionalboolcontentBasedDeduplicationoptionalBooleanContentBasedDeduplicationoptionalboolContentBasedDeduplicationoptional*bool= false#notes
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.)
dataKeyReuseoptionalDurationdata_key_reuseoptionalDurationdataKeyReuseoptionalDurationDataKeyReuseoptionalDurationDataKeyReuseoptionalDuration= Duration.minutes(5)#The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 minutes).
deadLetterQueueoptionalDeadLetterQueuedead_letter_queueoptionalDeadLetterQueuedeadLetterQueueoptionalDeadLetterQueueDeadLetterQueueoptionalDeadLetterQueueDeadLetterQueueoptionalDeadLetterQueue#Default: no dead-letter queue
deduplicationScopeoptionalDeduplicationScopededuplication_scopeoptionalDeduplicationScopededuplicationScopeoptionalDeduplicationScopeDeduplicationScopeoptionalDeduplicationScopeDeduplicationScopeoptionalDeduplicationScope= DeduplicationScope.QUEUE#(Only applies to FIFO queues.)
deliveryDelayoptionalDurationdelivery_delayoptionalDurationdeliveryDelayoptionalDurationDeliveryDelayoptionalDurationDeliveryDelayoptionalDuration= 0#You can specify an integer value of 0 to 900 (15 minutes). The default value is 0.
encryptionoptionalQueueEncryptionencryptionoptionalQueueEncryptionencryptionoptionalQueueEncryptionEncryptionoptionalQueueEncryptionEncryptionoptionalQueueEncryption#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.
encryptionMasterKeyoptionalIKeyencryption_master_keyoptionalIKeyencryptionMasterKeyoptionalIKeyEncryptionMasterKeyoptionalIKeyEncryptionMasterKeyoptionalIKey#Default: If encryption is set to KMS and not specified, a key will be created.
notes
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".
enforceSSLoptionalbooleanenforce_ssloptionalboolenforceSSLoptionalBooleanEnforceSSLoptionalboolEnforceSSLoptional*bool= false#Default: false, unless queueName ends in '.fifo' or 'contentBasedDeduplication' is true.
fifoThroughputLimitoptionalFifoThroughputLimitfifo_throughput_limitoptionalFifoThroughputLimitfifoThroughputLimitoptionalFifoThroughputLimitFifoThroughputLimitoptionalFifoThroughputLimitFifoThroughputLimitoptionalFifoThroughputLimit= FifoThroughputLimit.PER_QUEUE#(Only applies to FIFO queues.)
maxMessageSizeBytesoptionalnumbermax_message_size_bytesoptionalint | floatmaxMessageSizeBytesoptionalNumberMaxMessageSizeBytesoptionaldoubleMaxMessageSizeBytesoptional*float64= 1MiB#You can specify an integer value from 1024 bytes (1 KiB) to 1048576 bytes (1 MiB). The default value is 1048576 (1 MiB).
queueNameoptionalstringqueue_nameoptionalstrqueueNameoptionalStringQueueNameoptionalstringQueueNameoptional*string#Default: CloudFormation-generated name
If specified and this is a FIFO queue, must end in the string '.fifo'.
receiveMessageWaitTimeoptionalDurationreceive_message_wait_timeoptionalDurationreceiveMessageWaitTimeoptionalDurationReceiveMessageWaitTimeoptionalDurationReceiveMessageWaitTimeoptionalDuration= 0#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.
redriveAllowPolicyoptionalRedriveAllowPolicyredrive_allow_policyoptionalRedriveAllowPolicyredriveAllowPolicyoptionalRedriveAllowPolicyRedriveAllowPolicyoptionalRedriveAllowPolicyRedriveAllowPolicyoptionalRedriveAllowPolicy#Default: All source queues can designate this queue as their dead-letter queue.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#notes
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.
retentionPeriodoptionalDurationretention_periodoptionalDurationretentionPeriodoptionalDurationRetentionPeriodoptionalDurationRetentionPeriodoptionalDuration= Duration.days(4)#You can specify an integer value from 60 seconds (1 minute) to 1209600 seconds (14 days). The default value is 345600 seconds (4 days).
visibilityTimeoutoptionalDurationvisibility_timeoutoptionalDurationvisibilityTimeoutoptionalDurationVisibilityTimeoutoptionalDurationVisibilityTimeoutoptionalDuration= Duration.seconds(30)#notes
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.