Class: AWSCDK::SQS::QueueProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::SQS::QueueProps
- Defined in:
- sqs/queue_props.rb
Overview
Properties for creating a new Queue.
Instance Attribute Summary collapse
-
#content_based_deduplication ⇒ Boolean?
readonly
Specifies whether to enable content-based deduplication.
-
#data_key_reuse ⇒ AWSCDK::Duration?
readonly
The length of time that Amazon SQS reuses a data key before calling KMS again.
-
#dead_letter_queue ⇒ AWSCDK::SQS::DeadLetterQueue?
readonly
Send messages to this queue if they were unsuccessfully dequeued a number of times.
-
#deduplication_scope ⇒ AWSCDK::SQS::DeduplicationScope?
readonly
For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
-
#delivery_delay ⇒ AWSCDK::Duration?
readonly
The time in seconds that the delivery of all messages in the queue is delayed.
-
#encryption ⇒ AWSCDK::SQS::QueueEncryption?
readonly
Whether the contents of the queue are encrypted, and by what type of key.
-
#encryption_master_key ⇒ AWSCDK::KMS::IKey?
readonly
External KMS key to use for queue encryption.
-
#enforce_ssl ⇒ Boolean?
readonly
Enforce encryption of data in transit.
-
#fifo ⇒ Boolean?
readonly
Whether this a first-in-first-out (FIFO) queue.
-
#fifo_throughput_limit ⇒ AWSCDK::SQS::FifoThroughputLimit?
readonly
For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
-
#max_message_size_bytes ⇒ Numeric?
readonly
The limit of how many bytes that a message can contain before Amazon SQS rejects it.
-
#queue_name ⇒ String?
readonly
A name for the queue.
-
#receive_message_wait_time ⇒ AWSCDK::Duration?
readonly
Default wait time for ReceiveMessage calls.
-
#redrive_allow_policy ⇒ AWSCDK::SQS::RedriveAllowPolicy?
readonly
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.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
Policy to apply when the queue is removed from the stack.
-
#retention_period ⇒ AWSCDK::Duration?
readonly
The number of seconds that Amazon SQS retains a message.
-
#visibility_timeout ⇒ AWSCDK::Duration?
readonly
Timeout of processing a single message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content_based_deduplication: nil, data_key_reuse: nil, dead_letter_queue: nil, deduplication_scope: nil, delivery_delay: nil, encryption: nil, encryption_master_key: nil, enforce_ssl: nil, fifo: nil, fifo_throughput_limit: nil, max_message_size_bytes: nil, queue_name: nil, receive_message_wait_time: nil, redrive_allow_policy: nil, removal_policy: nil, retention_period: nil, visibility_timeout: nil) ⇒ QueueProps
constructor
A new instance of QueueProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(content_based_deduplication: nil, data_key_reuse: nil, dead_letter_queue: nil, deduplication_scope: nil, delivery_delay: nil, encryption: nil, encryption_master_key: nil, enforce_ssl: nil, fifo: nil, fifo_throughput_limit: nil, max_message_size_bytes: nil, queue_name: nil, receive_message_wait_time: nil, redrive_allow_policy: nil, removal_policy: nil, retention_period: nil, visibility_timeout: nil) ⇒ QueueProps
Returns a new instance of QueueProps.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'sqs/queue_props.rb', line 24 def initialize(content_based_deduplication: nil, data_key_reuse: nil, dead_letter_queue: nil, deduplication_scope: nil, delivery_delay: nil, encryption: nil, encryption_master_key: nil, enforce_ssl: nil, fifo: nil, fifo_throughput_limit: nil, max_message_size_bytes: nil, queue_name: nil, receive_message_wait_time: nil, redrive_allow_policy: nil, removal_policy: nil, retention_period: nil, visibility_timeout: nil) @content_based_deduplication = content_based_deduplication Jsii::Type.check_type(@content_based_deduplication, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "contentBasedDeduplication") unless @content_based_deduplication.nil? @data_key_reuse = data_key_reuse Jsii::Type.check_type(@data_key_reuse, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "dataKeyReuse") unless @data_key_reuse.nil? @dead_letter_queue = dead_letter_queue.is_a?(Hash) ? ::AWSCDK::SQS::DeadLetterQueue.new(**dead_letter_queue.transform_keys(&:to_sym)) : dead_letter_queue Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLkRlYWRMZXR0ZXJRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil? @deduplication_scope = deduplication_scope Jsii::Type.check_type(@deduplication_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLkRlZHVwbGljYXRpb25TY29wZSJ9")), "deduplicationScope") unless @deduplication_scope.nil? @delivery_delay = delivery_delay Jsii::Type.check_type(@delivery_delay, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "deliveryDelay") unless @delivery_delay.nil? @encryption = encryption Jsii::Type.check_type(@encryption, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLlF1ZXVlRW5jcnlwdGlvbiJ9")), "encryption") unless @encryption.nil? @encryption_master_key = encryption_master_key Jsii::Type.check_type(@encryption_master_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionMasterKey") unless @encryption_master_key.nil? @enforce_ssl = enforce_ssl Jsii::Type.check_type(@enforce_ssl, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enforceSSL") unless @enforce_ssl.nil? @fifo = fifo Jsii::Type.check_type(@fifo, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "fifo") unless @fifo.nil? @fifo_throughput_limit = fifo_throughput_limit Jsii::Type.check_type(@fifo_throughput_limit, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLkZpZm9UaHJvdWdocHV0TGltaXQifQ==")), "fifoThroughputLimit") unless @fifo_throughput_limit.nil? @max_message_size_bytes = Jsii::Type.check_type(@max_message_size_bytes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxMessageSizeBytes") unless @max_message_size_bytes.nil? @queue_name = queue_name Jsii::Type.check_type(@queue_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queueName") unless @queue_name.nil? @receive_message_wait_time = Jsii::Type.check_type(@receive_message_wait_time, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "receiveMessageWaitTime") unless @receive_message_wait_time.nil? @redrive_allow_policy = redrive_allow_policy.is_a?(Hash) ? ::AWSCDK::SQS::RedriveAllowPolicy.new(**redrive_allow_policy.transform_keys(&:to_sym)) : redrive_allow_policy Jsii::Type.check_type(@redrive_allow_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLlJlZHJpdmVBbGxvd1BvbGljeSJ9")), "redriveAllowPolicy") unless @redrive_allow_policy.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @retention_period = retention_period Jsii::Type.check_type(@retention_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "retentionPeriod") unless @retention_period.nil? @visibility_timeout = visibility_timeout Jsii::Type.check_type(@visibility_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "visibilityTimeout") unless @visibility_timeout.nil? end |
Instance Attribute Details
#content_based_deduplication ⇒ Boolean? (readonly)
Default: 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.)
74 75 76 |
# File 'sqs/queue_props.rb', line 74 def content_based_deduplication @content_based_deduplication end |
#data_key_reuse ⇒ AWSCDK::Duration? (readonly)
Default: 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).
82 83 84 |
# File 'sqs/queue_props.rb', line 82 def data_key_reuse @data_key_reuse end |
#dead_letter_queue ⇒ AWSCDK::SQS::DeadLetterQueue? (readonly)
Default: no dead-letter queue
Send messages to this queue if they were unsuccessfully dequeued a number of times.
87 88 89 |
# File 'sqs/queue_props.rb', line 87 def dead_letter_queue @dead_letter_queue end |
#deduplication_scope ⇒ AWSCDK::SQS::DeduplicationScope? (readonly)
Default: 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.)
94 95 96 |
# File 'sqs/queue_props.rb', line 94 def deduplication_scope @deduplication_scope end |
#delivery_delay ⇒ AWSCDK::Duration? (readonly)
Default: 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.
102 103 104 |
# File 'sqs/queue_props.rb', line 102 def delivery_delay @delivery_delay end |
#encryption ⇒ AWSCDK::SQS::QueueEncryption? (readonly)
Default: SQS_MANAGED (SSE-SQS) for newly created queues
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.
110 111 112 |
# File 'sqs/queue_props.rb', line 110 def encryption @encryption end |
#encryption_master_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: If encryption is set to KMS and not specified, a key will be created.
External KMS 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
data_key_reuse_secs seconds.
If the 'encryptionMasterKey' property is set, 'encryption' type will be implicitly set to "KMS".
122 123 124 |
# File 'sqs/queue_props.rb', line 122 def encryption_master_key @encryption_master_key end |
#enforce_ssl ⇒ Boolean? (readonly)
Default: false
Enforce encryption of data in transit.
128 129 130 |
# File 'sqs/queue_props.rb', line 128 def enforce_ssl @enforce_ssl end |
#fifo ⇒ Boolean? (readonly)
Default: false, unless queueName ends in '.fifo' or 'contentBasedDeduplication' is true.
Whether this a first-in-first-out (FIFO) queue.
133 134 135 |
# File 'sqs/queue_props.rb', line 133 def fifo @fifo end |
#fifo_throughput_limit ⇒ AWSCDK::SQS::FifoThroughputLimit? (readonly)
Default: 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.)
140 141 142 |
# File 'sqs/queue_props.rb', line 140 def fifo_throughput_limit @fifo_throughput_limit end |
#max_message_size_bytes ⇒ Numeric? (readonly)
Default: 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).
148 149 150 |
# File 'sqs/queue_props.rb', line 148 def @max_message_size_bytes end |
#queue_name ⇒ String? (readonly)
Default: CloudFormation-generated name
A name for the queue.
If specified and this is a FIFO queue, must end in the string '.fifo'.
155 156 157 |
# File 'sqs/queue_props.rb', line 155 def queue_name @queue_name end |
#receive_message_wait_time ⇒ AWSCDK::Duration? (readonly)
Default: 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.
165 166 167 |
# File 'sqs/queue_props.rb', line 165 def @receive_message_wait_time end |
#redrive_allow_policy ⇒ AWSCDK::SQS::RedriveAllowPolicy? (readonly)
Default: - All source queues can designate this queue as their dead-letter queue.
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.
170 171 172 |
# File 'sqs/queue_props.rb', line 170 def redrive_allow_policy @redrive_allow_policy end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: 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.
180 181 182 |
# File 'sqs/queue_props.rb', line 180 def removal_policy @removal_policy end |
#retention_period ⇒ AWSCDK::Duration? (readonly)
Default: 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).
188 189 190 |
# File 'sqs/queue_props.rb', line 188 def retention_period @retention_period end |
#visibility_timeout ⇒ AWSCDK::Duration? (readonly)
Default: 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.
200 201 202 |
# File 'sqs/queue_props.rb', line 200 def visibility_timeout @visibility_timeout end |
Class Method Details
.jsii_properties ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'sqs/queue_props.rb', line 202 def self.jsii_properties { :content_based_deduplication => "contentBasedDeduplication", :data_key_reuse => "dataKeyReuse", :dead_letter_queue => "deadLetterQueue", :deduplication_scope => "deduplicationScope", :delivery_delay => "deliveryDelay", :encryption => "encryption", :encryption_master_key => "encryptionMasterKey", :enforce_ssl => "enforceSSL", :fifo => "fifo", :fifo_throughput_limit => "fifoThroughputLimit", :max_message_size_bytes => "maxMessageSizeBytes", :queue_name => "queueName", :receive_message_wait_time => "receiveMessageWaitTime", :redrive_allow_policy => "redriveAllowPolicy", :removal_policy => "removalPolicy", :retention_period => "retentionPeriod", :visibility_timeout => "visibilityTimeout", } end |
Instance Method Details
#to_jsii ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'sqs/queue_props.rb', line 224 def to_jsii result = {} result.merge!({ "contentBasedDeduplication" => @content_based_deduplication, "dataKeyReuse" => @data_key_reuse, "deadLetterQueue" => @dead_letter_queue, "deduplicationScope" => @deduplication_scope, "deliveryDelay" => @delivery_delay, "encryption" => @encryption, "encryptionMasterKey" => @encryption_master_key, "enforceSSL" => @enforce_ssl, "fifo" => @fifo, "fifoThroughputLimit" => @fifo_throughput_limit, "maxMessageSizeBytes" => @max_message_size_bytes, "queueName" => @queue_name, "receiveMessageWaitTime" => @receive_message_wait_time, "redriveAllowPolicy" => @redrive_allow_policy, "removalPolicy" => @removal_policy, "retentionPeriod" => @retention_period, "visibilityTimeout" => @visibility_timeout, }) result.compact end |