Interface IQueueProps
Properties for creating a new Queue.
Namespace: Amazon.CDK.AWS.SQS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IQueueProps
Syntax (vb)
Public Interface IQueueProps
Remarks
ExampleMetadata: infused
Examples
var topic = new Topic(this, "Topic");
var dlQueue = new Queue(this, "DeadLetterQueue", new QueueProps {
QueueName = "MySubscription_DLQ",
RetentionPeriod = Duration.Days(14)
});
new Subscription(this, "Subscription", new SubscriptionProps {
Endpoint = "endpoint",
Protocol = SubscriptionProtocol.LAMBDA,
Topic = topic,
DeadLetterQueue = dlQueue
});
Synopsis
Properties
ContentBasedDeduplication | Specifies whether to enable content-based deduplication. |
DataKeyReuse | The length of time that Amazon SQS reuses a data key before calling KMS again. |
DeadLetterQueue | Send messages to this queue if they were unsuccessfully dequeued a number of times. |
DeduplicationScope | For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. |
DeliveryDelay | The time in seconds that the delivery of all messages in the queue is delayed. |
Encryption | Whether the contents of the queue are encrypted, and by what type of key. |
EncryptionMasterKey | External KMS key to use for queue encryption. |
EnforceSSL | Enforce encryption of data in transit. |
Fifo | Whether this a first-in-first-out (FIFO) queue. |
FifoThroughputLimit | For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. |
MaxMessageSizeBytes | The limit of how many bytes that a message can contain before Amazon SQS rejects it. |
QueueName | A name for the queue. |
ReceiveMessageWaitTime | Default wait time for ReceiveMessage calls. |
RedriveAllowPolicy | 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. |
RemovalPolicy | Policy to apply when the queue is removed from the stack. |
RetentionPeriod | The number of seconds that Amazon SQS retains a message. |
VisibilityTimeout | Timeout of processing a single message. |
Properties
ContentBasedDeduplication
Specifies whether to enable content-based deduplication.
virtual Nullable<bool> ContentBasedDeduplication { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
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
DataKeyReuse
The length of time that Amazon SQS reuses a data key before calling KMS again.
virtual Duration DataKeyReuse { get; }
Property Value
Remarks
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)
DeadLetterQueue
Send messages to this queue if they were unsuccessfully dequeued a number of times.
virtual IDeadLetterQueue DeadLetterQueue { get; }
Property Value
Remarks
Default: no dead-letter queue
DeduplicationScope
For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
virtual Nullable<DeduplicationScope> DeduplicationScope { get; }
Property Value
System.Nullable<DeduplicationScope>
Remarks
(Only applies to FIFO queues.)
Default: DeduplicationScope.QUEUE
DeliveryDelay
The time in seconds that the delivery of all messages in the queue is delayed.
virtual Duration DeliveryDelay { get; }
Property Value
Remarks
You can specify an integer value of 0 to 900 (15 minutes). The default value is 0.
Default: 0
Encryption
Whether the contents of the queue are encrypted, and by what type of key.
virtual Nullable<QueueEncryption> Encryption { get; }
Property Value
System.Nullable<QueueEncryption>
Remarks
Be aware that encryption is not available in all regions, please see the docs for current availability details.
Default: SQS_MANAGED (SSE-SQS) for newly created queues
EncryptionMasterKey
External KMS key to use for queue encryption.
virtual IKey EncryptionMasterKey { get; }
Property Value
Remarks
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.
EnforceSSL
Enforce encryption of data in transit.
virtual Nullable<bool> EnforceSSL { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Fifo
Whether this a first-in-first-out (FIFO) queue.
virtual Nullable<bool> Fifo { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false, unless queueName ends in '.fifo' or 'contentBasedDeduplication' is true.
FifoThroughputLimit
For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
virtual Nullable<FifoThroughputLimit> FifoThroughputLimit { get; }
Property Value
System.Nullable<FifoThroughputLimit>
Remarks
(Only applies to FIFO queues.)
Default: FifoThroughputLimit.PER_QUEUE
MaxMessageSizeBytes
The limit of how many bytes that a message can contain before Amazon SQS rejects it.
virtual Nullable<double> MaxMessageSizeBytes { get; }
Property Value
System.Nullable<System.Double>
Remarks
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
QueueName
A name for the queue.
virtual string QueueName { get; }
Property Value
System.String
Remarks
If specified and this is a FIFO queue, must end in the string '.fifo'.
Default: CloudFormation-generated name
ReceiveMessageWaitTime
Default wait time for ReceiveMessage calls.
virtual Duration ReceiveMessageWaitTime { get; }
Property Value
Remarks
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
RedriveAllowPolicy
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.
virtual IRedriveAllowPolicy RedriveAllowPolicy { get; }
Property Value
Remarks
Default: - All source queues can designate this queue as their dead-letter queue.
RemovalPolicy
Policy to apply when the queue is removed from the stack.
virtual Nullable<RemovalPolicy> RemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
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.
Default: RemovalPolicy.DESTROY
RetentionPeriod
The number of seconds that Amazon SQS retains a message.
virtual Duration RetentionPeriod { get; }
Property Value
Remarks
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)
VisibilityTimeout
Timeout of processing a single message.
virtual Duration VisibilityTimeout { get; }
Property Value
Remarks
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)