QueueBase
- class aws_cdk.aws_sqs.QueueBase(scope, id, *, account=None, environment_from_arn=None, physical_name=None, region=None)
Bases:
ResourceReference to a new or existing Amazon SQS queue.
- Parameters:
scope (
Construct)id (
str)account (
Optional[str]) – The AWS account ID this resource belongs to. Default: - the resource is in the same account as the stack it belongs toenvironment_from_arn (
Optional[str]) – ARN to deduce region and account from. The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources. Cannot be supplied together with eitheraccountorregion. Default: - take environment fromaccount,regionparameters, or use Stack environment.physical_name (
Optional[str]) – The value passed in by users to the physical name prop of the resource. -undefinedimplies that a physical name will be allocated by CloudFormation during deployment. - a concrete value implies a specific physical name -PhysicalName.GENERATE_IF_NEEDEDis a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation. Default: - The physical name will be allocated by CloudFormation at deployment timeregion (
Optional[str]) – The AWS region this resource belongs to. Default: - the resource is in the same region as the stack it belongs to
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
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
- 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
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*
- Parameters:
grantee (
IGrantable) – Principal to grant send rights to.- Return type:
- metric(metric_name, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_approximate_age_of_oldest_message(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_approximate_number_of_messages_delayed(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_approximate_number_of_messages_not_visible(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_approximate_number_of_messages_visible(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_number_of_empty_receives(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_number_of_messages_deleted(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_number_of_messages_received(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_number_of_messages_sent(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- metric_sent_message_size(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=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. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
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.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.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 streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- encryption_master_key
If this queue is server-side encrypted, this is the KMS encryption key.
- encryption_type
Whether the contents of the queue are encrypted, and by what type of key.
- env
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.
- fifo
Whether this queue is an Amazon SQS FIFO queue.
If false, this is a standard queue.
- node
The tree node.
- 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 is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct)- Return type:
bool