Class: AWSCDK::SQS::Queue

Inherits:
QueueBase
  • Object
show all
Defined in:
sqs/queue.rb

Overview

A new Amazon SQS queue.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ Queue

Returns a new instance of Queue.

Parameters:



11
12
13
14
15
16
17
# File 'sqs/queue.rb', line 11

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::SQS::QueueProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLlF1ZXVlUHJvcHMifQ==")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_queue_arn(scope, id, queue_arn) ⇒ AWSCDK::SQS::IQueue

Import an existing SQS queue provided an ARN.

Parameters:

  • scope (Constructs::Construct)

    The parent creating construct.

  • id (String)

    The construct's name.

  • queue_arn (String)

    queue ARN (i.e. arn:aws:sqs:us-east-2:444455556666:queue1).

Returns:



67
68
69
70
71
72
# File 'sqs/queue.rb', line 67

def self.from_queue_arn(scope, id, queue_arn)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(queue_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queueArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_sqs.Queue", "fromQueueArn", [scope, id, queue_arn])
end

.from_queue_attributes(scope, id, attrs) ⇒ AWSCDK::SQS::IQueue

Import an existing queue.

Parameters:

Returns:



80
81
82
83
84
85
86
# File 'sqs/queue.rb', line 80

def self.from_queue_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::SQS::QueueAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLlF1ZXVlQXR0cmlidXRlcyJ9")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_sqs.Queue", "fromQueueAttributes", [scope, id, attrs])
end

.jsii_overridable_methodsObject



19
20
21
22
23
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.rb', line 19

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :auto_create_policy => { kind: :property, name: "autoCreatePolicy", is_optional: false },
    :fifo => { kind: :property, name: "fifo", is_optional: false },
    :grants => { kind: :property, name: "grants", is_optional: false },
    :queue_arn => { kind: :property, name: "queueArn", is_optional: false },
    :queue_name => { kind: :property, name: "queueName", is_optional: false },
    :queue_ref => { kind: :property, name: "queueRef", is_optional: false },
    :queue_url => { kind: :property, name: "queueUrl", is_optional: false },
    :encryption_master_key => { kind: :property, name: "encryptionMasterKey", is_optional: true },
    :encryption_type => { kind: :property, name: "encryptionType", is_optional: true },
    :dead_letter_queue => { kind: :property, name: "deadLetterQueue", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_to_resource_policy => { kind: :method, name: "addToResourcePolicy", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_consume_messages => { kind: :method, name: "grantConsumeMessages", is_optional: false },
    :grant_on_key => { kind: :method, name: "grantOnKey", is_optional: false },
    :grant_purge => { kind: :method, name: "grantPurge", is_optional: false },
    :grant_send_messages => { kind: :method, name: "grantSendMessages", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_approximate_age_of_oldest_message => { kind: :method, name: "metricApproximateAgeOfOldestMessage", is_optional: false },
    :metric_approximate_number_of_messages_delayed => { kind: :method, name: "metricApproximateNumberOfMessagesDelayed", is_optional: false },
    :metric_approximate_number_of_messages_not_visible => { kind: :method, name: "metricApproximateNumberOfMessagesNotVisible", is_optional: false },
    :metric_approximate_number_of_messages_visible => { kind: :method, name: "metricApproximateNumberOfMessagesVisible", is_optional: false },
    :metric_number_of_empty_receives => { kind: :method, name: "metricNumberOfEmptyReceives", is_optional: false },
    :metric_number_of_messages_deleted => { kind: :method, name: "metricNumberOfMessagesDeleted", is_optional: false },
    :metric_number_of_messages_received => { kind: :method, name: "metricNumberOfMessagesReceived", is_optional: false },
    :metric_number_of_messages_sent => { kind: :method, name: "metricNumberOfMessagesSent", is_optional: false },
    :metric_sent_message_size => { kind: :method, name: "metricSentMessageSize", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


201
202
203
# File 'sqs/queue.rb', line 201

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_sqs.Queue", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_to_resource_policy(statement) ⇒ AWSCDK::IAM::AddToResourcePolicyResult

Adds a statement to the IAM resource policy associated with this queue.

If this queue was created in this stack (new Queue), a queue policy will be automatically created upon the first call to add_to_policy. If the queue is imported (Queue.import), then this is a no-op.



310
311
312
313
# File 'sqs/queue.rb', line 310

def add_to_resource_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToResourcePolicy", [statement])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



245
246
247
248
# File 'sqs/queue.rb', line 245

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



262
263
264
265
# File 'sqs/queue.rb', line 262

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#auto_create_policyBoolean

Controls automatic creation of policy objects.

Set by subclasses.

Returns:

  • (Boolean)


136
137
138
# File 'sqs/queue.rb', line 136

def auto_create_policy()
  jsii_get_property("autoCreatePolicy")
end

#dead_letter_queueAWSCDK::SQS::DeadLetterQueue?

If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.



208
209
210
# File 'sqs/queue.rb', line 208

def dead_letter_queue()
  jsii_get_property("deadLetterQueue")
end

#encryption_master_keyAWSCDK::KMS::IKey?

If this queue is encrypted, this is the KMS key.

Returns:



187
188
189
# File 'sqs/queue.rb', line 187

def encryption_master_key()
  jsii_get_property("encryptionMasterKey")
end

#encryption_typeAWSCDK::SQS::QueueEncryption?

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



194
195
196
# File 'sqs/queue.rb', line 194

def encryption_type()
  jsii_get_property("encryptionType")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



106
107
108
# File 'sqs/queue.rb', line 106

def env()
  jsii_get_property("env")
end

#fifoBoolean

Whether this queue is an Amazon SQS FIFO queue.

If false, this is a standard queue.

Returns:

  • (Boolean)


145
146
147
# File 'sqs/queue.rb', line 145

def fifo()
  jsii_get_property("fifo")
end

#generate_physical_nameString

Returns:

  • (String)


268
269
270
# File 'sqs/queue.rb', line 268

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


282
283
284
285
286
287
# File 'sqs/queue.rb', line 282

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


297
298
299
300
# File 'sqs/queue.rb', line 297

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant

Grant the actions defined in queueActions to the identity Principal given on this SQS queue resource.

[disable-awslint:no-grants]

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    Principal to grant right to.

  • actions (Array<String>)

    The actions to grant.

Returns:



322
323
324
325
326
327
328
# File 'sqs/queue.rb', line 322

def grant(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grant", [grantee, *actions])
end

#grant_consume_messages(grantee) ⇒ AWSCDK::IAM::Grant

Grant permissions to consume messages from a queue.

This will grant the following permissions:

  • sqs:ChangeMessageVisibility
  • sqs:DeleteMessage
  • sqs:ReceiveMessage
  • sqs:GetQueueAttributes
  • sqs:GetQueueUrl

If encryption is used, permission to use the key to decrypt the contents of the queue will also be granted to the same principal.

This will grant the following KMS permissions:

  • kms:Decrypt

The use of this method is discouraged. Please use grants.consumeMessages() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



352
353
354
355
# File 'sqs/queue.rb', line 352

def grant_consume_messages(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantConsumeMessages", [grantee])
end

#grant_on_key(grantee, *actions) ⇒ AWSCDK::IAM::GrantOnKeyResult

Gives permissions to a grantable entity to perform actions on the encryption key.

Parameters:

Returns:



362
363
364
365
366
367
368
# File 'sqs/queue.rb', line 362

def grant_on_key(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grantOnKey", [grantee, *actions])
end

#grant_purge(grantee) ⇒ AWSCDK::IAM::Grant

Grant an IAM principal permissions to purge all messages from the queue.

This will grant the following permissions:

  • sqs:PurgeQueue
  • sqs:GetQueueAttributes
  • sqs:GetQueueUrl

The use of this method is discouraged. Please use grants.purge() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



384
385
386
387
# File 'sqs/queue.rb', line 384

def grant_purge(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantPurge", [grantee])
end

#grant_send_messages(grantee) ⇒ AWSCDK::IAM::Grant

Grant access to send messages to a queue to the given identity.

This will grant the following permissions:

  • sqs:SendMessage
  • sqs:GetQueueAttributes
  • sqs:GetQueueUrl

If encryption is used, permission to use the key to encrypt/decrypt the contents of the queue will also be granted to the same principal.

This will grant the following KMS permissions:

  • kms:Decrypt
  • kms:Encrypt
  • kms:ReEncrypt*
  • kms:GenerateDataKey*

The use of this method is discouraged. Please use grants.sendMessages() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



412
413
414
415
# File 'sqs/queue.rb', line 412

def grant_send_messages(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantSendMessages", [grantee])
end

#grantsAWSCDK::SQS::QueueGrants

Collection of grant methods for a Queue.



152
153
154
# File 'sqs/queue.rb', line 152

def grants()
  jsii_get_property("grants")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return the given named metric for this Queue.

Parameters:

Returns:



422
423
424
425
426
427
# File 'sqs/queue.rb', line 422

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_approximate_age_of_oldest_message(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The approximate age of the oldest non-deleted message in the queue.

Maximum over 5 minutes

Parameters:

Returns:



435
436
437
438
439
# File 'sqs/queue.rb', line 435

def metric_approximate_age_of_oldest_message(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricApproximateAgeOfOldestMessage", [props])
end

#metric_approximate_number_of_messages_delayed(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages in the queue that are delayed and not available for reading immediately.

Maximum over 5 minutes

Parameters:

Returns:



447
448
449
450
451
# File 'sqs/queue.rb', line 447

def metric_approximate_number_of_messages_delayed(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricApproximateNumberOfMessagesDelayed", [props])
end

#metric_approximate_number_of_messages_not_visible(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages that are in flight.

Maximum over 5 minutes

Parameters:

Returns:



459
460
461
462
463
# File 'sqs/queue.rb', line 459

def metric_approximate_number_of_messages_not_visible(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricApproximateNumberOfMessagesNotVisible", [props])
end

#metric_approximate_number_of_messages_visible(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages available for retrieval from the queue.

Maximum over 5 minutes

Parameters:

Returns:



471
472
473
474
475
# File 'sqs/queue.rb', line 471

def metric_approximate_number_of_messages_visible(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricApproximateNumberOfMessagesVisible", [props])
end

#metric_number_of_empty_receives(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of ReceiveMessage API calls that did not return a message.

Sum over 5 minutes

Parameters:

Returns:



483
484
485
486
487
# File 'sqs/queue.rb', line 483

def metric_number_of_empty_receives(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNumberOfEmptyReceives", [props])
end

#metric_number_of_messages_deleted(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages deleted from the queue.

Sum over 5 minutes

Parameters:

Returns:



495
496
497
498
499
# File 'sqs/queue.rb', line 495

def metric_number_of_messages_deleted(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNumberOfMessagesDeleted", [props])
end

#metric_number_of_messages_received(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages returned by calls to the ReceiveMessage action.

Sum over 5 minutes

Parameters:

Returns:



507
508
509
510
511
# File 'sqs/queue.rb', line 507

def metric_number_of_messages_received(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNumberOfMessagesReceived", [props])
end

#metric_number_of_messages_sent(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of messages added to a queue.

Sum over 5 minutes

Parameters:

Returns:



519
520
521
522
523
# File 'sqs/queue.rb', line 519

def metric_number_of_messages_sent(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNumberOfMessagesSent", [props])
end

#metric_sent_message_size(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The size of messages added to a queue.

Average over 5 minutes

Parameters:

Returns:



531
532
533
534
535
# File 'sqs/queue.rb', line 531

def metric_sent_message_size(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricSentMessageSize", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


91
92
93
# File 'sqs/queue.rb', line 91

def node()
  jsii_get_property("node")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


120
121
122
# File 'sqs/queue.rb', line 120

def physical_name()
  jsii_get_property("physicalName")
end

#queue_arnString

The ARN of this queue.

Returns:

  • (String)


159
160
161
# File 'sqs/queue.rb', line 159

def queue_arn()
  jsii_get_property("queueArn")
end

#queue_nameString

The name of this queue.

Returns:

  • (String)


166
167
168
# File 'sqs/queue.rb', line 166

def queue_name()
  jsii_get_property("queueName")
end

#queue_refAWSCDK::Interfaces::AWSSQS::QueueReference

A reference to a Queue resource.



173
174
175
# File 'sqs/queue.rb', line 173

def queue_ref()
  jsii_get_property("queueRef")
end

#queue_urlString

The URL of this queue.

Returns:

  • (String)


180
181
182
# File 'sqs/queue.rb', line 180

def queue_url()
  jsii_get_property("queueUrl")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



127
128
129
# File 'sqs/queue.rb', line 127

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


215
216
217
# File 'sqs/queue.rb', line 215

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


228
229
230
231
232
233
# File 'sqs/queue.rb', line 228

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end