Class QueueBase
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IQueue
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
- Direct Known Subclasses:
Queue
-
Nested Class Summary
Nested classes/interfaces inherited from class software.constructs.Construct
software.constructs.Construct.Builder
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.sqs.IQueue
IQueue.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
QueueBase
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
QueueBase
(software.amazon.jsii.JsiiObjectRef objRef) protected
protected
QueueBase
(software.constructs.Construct scope, String id, ResourceProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddToResourcePolicy
(PolicyStatement statement) Adds a statement to the IAM resource policy associated with this queue.protected abstract Boolean
Controls automatic creation of policy objects.abstract IKey
If this queue is server-side encrypted, this is the KMS encryption key.abstract Boolean
getFifo()
Whether this queue is an Amazon SQS FIFO queue.abstract String
The ARN of this queue.abstract String
The name of this queue.abstract String
The URL of this queue.grant
(IGrantable grantee, @NotNull String... actions) Grant the actions defined in queueActions to the identity Principal given on this SQS queue resource.grantConsumeMessages
(IGrantable grantee) Grant permissions to consume messages from a queue.grantPurge
(IGrantable grantee) Grant an IAM principal permissions to purge all messages from the queue.grantSendMessages
(IGrantable grantee) Grant access to send messages to a queue to the given identity.Return the given named metric for this Queue.metric
(String metricName, MetricOptions props) Return the given named metric for this Queue.The approximate age of the oldest non-deleted message in the queue.The approximate age of the oldest non-deleted message in the queue.The number of messages in the queue that are delayed and not available for reading immediately.The number of messages in the queue that are delayed and not available for reading immediately.The number of messages that are in flight.The number of messages that are in flight.The number of messages available for retrieval from the queue.The number of messages available for retrieval from the queue.The number of ReceiveMessage API calls that did not return a message.The number of ReceiveMessage API calls that did not return a message.The number of messages deleted from the queue.The number of messages deleted from the queue.The number of messages returned by calls to the ReceiveMessage action.The number of messages returned by calls to the ReceiveMessage action.The number of messages added to a queue.The number of messages added to a queue.The size of messages added to a queue.The size of messages added to a queue.validate()
Validate the current construct.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
QueueBase
protected QueueBase(software.amazon.jsii.JsiiObjectRef objRef) -
QueueBase
protected QueueBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
QueueBase
@Stability(Stable) protected QueueBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
QueueBase
@Stability(Stable) protected QueueBase(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
addToResourcePolicy
@Stability(Stable) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement 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.- Specified by:
addToResourcePolicy
in interfaceIQueue
- Parameters:
statement
- This parameter is required.
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull @NotNull String... actions) Grant the actions defined in queueActions to the identity Principal given on this SQS queue resource. -
grantConsumeMessages
Grant permissions to consume messages from a queue.This will grant the following permissions:
- sqs:ChangeMessageVisibility
- sqs:DeleteMessage
- sqs:ReceiveMessage
- sqs:GetQueueAttributes
- sqs:GetQueueUrl
- Specified by:
grantConsumeMessages
in interfaceIQueue
- Parameters:
grantee
- Principal to grant consume rights to. This parameter is required.
-
grantPurge
Grant an IAM principal permissions to purge all messages from the queue.This will grant the following permissions:
- sqs:PurgeQueue
- sqs:GetQueueAttributes
- sqs:GetQueueUrl
- Specified by:
grantPurge
in interfaceIQueue
- Parameters:
grantee
- Principal to grant send rights to. This parameter is required.
-
grantSendMessages
Grant access to send messages to a queue to the given identity.This will grant the following permissions:
- sqs:SendMessage
- sqs:GetQueueAttributes
- sqs:GetQueueUrl
- Specified by:
grantSendMessages
in interfaceIQueue
- Parameters:
grantee
- Principal to grant send rights to. This parameter is required.
-
metric
@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this Queue. -
metric
Return the given named metric for this Queue. -
metricApproximateAgeOfOldestMessage
@Stability(Stable) @NotNull public Metric metricApproximateAgeOfOldestMessage(@Nullable MetricOptions props) The approximate age of the oldest non-deleted message in the queue.Maximum over 5 minutes
- Specified by:
metricApproximateAgeOfOldestMessage
in interfaceIQueue
- Parameters:
props
-
-
metricApproximateAgeOfOldestMessage
The approximate age of the oldest non-deleted message in the queue.Maximum over 5 minutes
- Specified by:
metricApproximateAgeOfOldestMessage
in interfaceIQueue
-
metricApproximateNumberOfMessagesDelayed
@Stability(Stable) @NotNull public Metric metricApproximateNumberOfMessagesDelayed(@Nullable MetricOptions props) The number of messages in the queue that are delayed and not available for reading immediately.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesDelayed
in interfaceIQueue
- Parameters:
props
-
-
metricApproximateNumberOfMessagesDelayed
The number of messages in the queue that are delayed and not available for reading immediately.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesDelayed
in interfaceIQueue
-
metricApproximateNumberOfMessagesNotVisible
@Stability(Stable) @NotNull public Metric metricApproximateNumberOfMessagesNotVisible(@Nullable MetricOptions props) The number of messages that are in flight.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesNotVisible
in interfaceIQueue
- Parameters:
props
-
-
metricApproximateNumberOfMessagesNotVisible
The number of messages that are in flight.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesNotVisible
in interfaceIQueue
-
metricApproximateNumberOfMessagesVisible
@Stability(Stable) @NotNull public Metric metricApproximateNumberOfMessagesVisible(@Nullable MetricOptions props) The number of messages available for retrieval from the queue.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesVisible
in interfaceIQueue
- Parameters:
props
-
-
metricApproximateNumberOfMessagesVisible
The number of messages available for retrieval from the queue.Maximum over 5 minutes
- Specified by:
metricApproximateNumberOfMessagesVisible
in interfaceIQueue
-
metricNumberOfEmptyReceives
@Stability(Stable) @NotNull public Metric metricNumberOfEmptyReceives(@Nullable MetricOptions props) The number of ReceiveMessage API calls that did not return a message.Sum over 5 minutes
- Specified by:
metricNumberOfEmptyReceives
in interfaceIQueue
- Parameters:
props
-
-
metricNumberOfEmptyReceives
The number of ReceiveMessage API calls that did not return a message.Sum over 5 minutes
- Specified by:
metricNumberOfEmptyReceives
in interfaceIQueue
-
metricNumberOfMessagesDeleted
@Stability(Stable) @NotNull public Metric metricNumberOfMessagesDeleted(@Nullable MetricOptions props) The number of messages deleted from the queue.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesDeleted
in interfaceIQueue
- Parameters:
props
-
-
metricNumberOfMessagesDeleted
The number of messages deleted from the queue.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesDeleted
in interfaceIQueue
-
metricNumberOfMessagesReceived
@Stability(Stable) @NotNull public Metric metricNumberOfMessagesReceived(@Nullable MetricOptions props) The number of messages returned by calls to the ReceiveMessage action.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesReceived
in interfaceIQueue
- Parameters:
props
-
-
metricNumberOfMessagesReceived
The number of messages returned by calls to the ReceiveMessage action.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesReceived
in interfaceIQueue
-
metricNumberOfMessagesSent
The number of messages added to a queue.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesSent
in interfaceIQueue
- Parameters:
props
-
-
metricNumberOfMessagesSent
The number of messages added to a queue.Sum over 5 minutes
- Specified by:
metricNumberOfMessagesSent
in interfaceIQueue
-
metricSentMessageSize
The size of messages added to a queue.Average over 5 minutes
- Specified by:
metricSentMessageSize
in interfaceIQueue
- Parameters:
props
-
-
metricSentMessageSize
The size of messages added to a queue.Average over 5 minutes
- Specified by:
metricSentMessageSize
in interfaceIQueue
-
validate
Validate the current construct.This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
-
getAutoCreatePolicy
Controls automatic creation of policy objects.Set by subclasses.
-
getFifo
Whether this queue is an Amazon SQS FIFO queue.If false, this is a standard queue.
-
getQueueArn
The ARN of this queue.- Specified by:
getQueueArn
in interfaceIQueue
-
getQueueName
The name of this queue.- Specified by:
getQueueName
in interfaceIQueue
-
getQueueUrl
The URL of this queue.- Specified by:
getQueueUrl
in interfaceIQueue
-
getEncryptionMasterKey
If this queue is server-side encrypted, this is the KMS encryption key.- Specified by:
getEncryptionMasterKey
in interfaceIQueue
-