Queue
- class aws_cdk.aws_sqs.Queue(scope, id, *, content_based_deduplication=None, data_key_reuse=None, dead_letter_queue=None, deduplication_scope=None, delivery_delay=None, encryption=None, encryption_master_key=None, fifo=None, fifo_throughput_limit=None, max_message_size_bytes=None, queue_name=None, receive_message_wait_time=None, removal_policy=None, retention_period=None, visibility_timeout=None)
Bases:
QueueBase
A new Amazon SQS queue.
- ExampleMetadata:
infused
Example:
# An sqs queue for unsuccessful invocations of a lambda function import aws_cdk.aws_sqs as sqs dead_letter_queue = sqs.Queue(self, "DeadLetterQueue") my_fn = lambda_.Function(self, "Fn", runtime=lambda_.Runtime.NODEJS_14_X, handler="index.handler", code=lambda_.Code.from_inline("// your code"), # sqs queue for unsuccessful invocations on_failure=destinations.SqsDestination(dead_letter_queue) )
- Parameters:
scope (
Construct
) –id (
str
) –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: falsedata_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 (
Union
[DeadLetterQueue
,Dict
[str
,Any
],None
]) – Send messages to this queue if they were unsuccessfully dequeued a number of times. Default: no dead-letter queuededuplication_scope (
Optional
[DeduplicationScope
]) – For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. (Only applies to FIFO queues.) Default: DeduplicationScope.QUEUEdelivery_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: 0encryption (
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: Unencryptedencryption_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 ofdataKeyReuseSecs
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.fifo_throughput_limit (
Optional
[FifoThroughputLimit
]) – 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.) Default: FifoThroughputLimit.PER_QUEUEmax_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: 256KiBqueue_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 namereceive_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: 0removal_policy (
Optional
[RemovalPolicy
]) – 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 thereforeDESTROY
. Change it toRETAIN
if the messages are so valuable that accidentally losing them would be unacceptable. Default: RemovalPolicy.DESTROYretention_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)
Methods
- add_to_resource_policy(statement)
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 toaddToPolicy
. If the queue is imported (Queue.import
), then this is a no-op.- Parameters:
statement (
PolicyStatement
) –- Return type:
- apply_removal_policy(policy)
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:
policy (
RemovalPolicy
) –- Return type:
None
- grant(grantee, *actions)
Grant the actions defined in queueActions to the identity Principal given on this SQS queue resource.
- Parameters:
grantee (
IGrantable
) – Principal to grant right to.actions (
str
) – The actions to grant.
- Return type:
- grant_consume_messages(grantee)
Grant permissions to consume messages from a queue.
This will grant the following permissions:
sqs:ChangeMessageVisibility
sqs:DeleteMessage
sqs:ReceiveMessage
sqs:GetQueueAttributes
sqs:GetQueueUrl
- Parameters:
grantee (
IGrantable
) – Principal to grant consume rights to.- Return type:
- grant_purge(grantee)
Grant an IAM principal permissions to purge all messages from the queue.
This will grant the following permissions:
sqs:PurgeQueue
sqs:GetQueueAttributes
sqs:GetQueueUrl
- Parameters:
grantee (
IGrantable
) – Principal to grant send rights to.- Return type:
- grant_send_messages(grantee)
Grant access to send messages to a queue to the given identity.
This will grant the following permissions:
sqs:SendMessage
sqs:GetQueueAttributes
sqs:GetQueueUrl
- Parameters:
grantee (
IGrantable
) – Principal to grant send rights to.- Return type:
- metric(metric_name, *, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
Return the given named metric for this Queue.
- Parameters:
metric_name (
str
) –account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) – Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No labelperiod (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_approximate_age_of_oldest_message(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The approximate age of the oldest non-deleted message in the queue.
Maximum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_approximate_number_of_messages_delayed(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages in the queue that are delayed and not available for reading immediately.
Maximum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_approximate_number_of_messages_not_visible(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages that are in flight.
Maximum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_approximate_number_of_messages_visible(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages available for retrieval from the queue.
Maximum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_number_of_empty_receives(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of ReceiveMessage API calls that did not return a message.
Sum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_number_of_messages_deleted(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages deleted from the queue.
Sum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_number_of_messages_received(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages returned by calls to the ReceiveMessage action.
Sum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_number_of_messages_sent(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The number of messages added to a queue.
Sum over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- metric_sent_message_size(*, account=None, color=None, dimensions=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
The size of messages added to a queue.
Average over 5 minutes
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions (
Optional
[Mapping
[str
,Any
]]) – (deprecated) Dimensions of the metric. Default: - No dimensions.dimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- dead_letter_queue
If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.
- encryption_master_key
If this queue is encrypted, this is the KMS key.
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- fifo
Whether this queue is an Amazon SQS FIFO queue.
If false, this is a standard queue.
- node
The construct tree node associated with this construct.
- queue_arn
The ARN of this queue.
- queue_name
The name of this queue.
- queue_url
The URL of this queue.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_queue_arn(scope, id, queue_arn)
Import an existing SQS queue provided an ARN.
- classmethod from_queue_attributes(scope, id, *, queue_arn, fifo=None, key_arn=None, queue_name=None, queue_url=None)
Import an existing queue.
- Parameters:
scope (
Construct
) –id (
str
) –queue_arn (
str
) – The ARN of the queue.fifo (
Optional
[bool
]) – Whether this queue is an Amazon SQS FIFO queue. If false, this is a standard queue. In case of a FIFO queue which is imported from a token, this value has to be explicitly set to true. Default: - if fifo is not specified, the property will be determined based on the queue name (not possible for FIFO queues imported from a token)key_arn (
Optional
[str
]) – KMS encryption key, if this queue is server-side encrypted by a KMS key. Default: - Nonequeue_name (
Optional
[str
]) – The name of the queue. Default: if queue name is not specified, the name will be derived from the queue ARNqueue_url (
Optional
[str
]) – The URL of the queue. Default: - ‘https://sqs.//’
- Return type:
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool