Class QueueBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, IQueue, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct
Direct Known Subclasses:
Queue

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.042Z") @Stability(Stable) public abstract class QueueBase extends Resource implements IQueue
Reference to a new or existing Amazon SQS queue.
  • 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 to addToPolicy. If the queue is imported (Queue.import), then this is a no-op.

      Specified by:
      addToResourcePolicy in interface IQueue
      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.

      Specified by:
      grant in interface IQueue
      Parameters:
      grantee - Principal to grant right to. This parameter is required.
      actions - The actions to grant. This parameter is required.
    • grantConsumeMessages

      @Stability(Stable) @NotNull public Grant grantConsumeMessages(@NotNull IGrantable 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

      Specified by:
      grantConsumeMessages in interface IQueue
      Parameters:
      grantee - Principal to grant consume rights to. This parameter is required.
    • grantPurge

      @Stability(Stable) @NotNull public Grant grantPurge(@NotNull IGrantable 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

      Specified by:
      grantPurge in interface IQueue
      Parameters:
      grantee - Principal to grant send rights to. This parameter is required.
    • grantSendMessages

      @Stability(Stable) @NotNull public Grant grantSendMessages(@NotNull IGrantable 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

      Specified by:
      grantSendMessages in interface IQueue
      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.

      Specified by:
      metric in interface IQueue
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this Queue.

      Specified by:
      metric in interface IQueue
      Parameters:
      metricName - This parameter is required.
    • 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 interface IQueue
      Parameters:
      props -
    • metricApproximateAgeOfOldestMessage

      @Stability(Stable) @NotNull public Metric metricApproximateAgeOfOldestMessage()
      The approximate age of the oldest non-deleted message in the queue.

      Maximum over 5 minutes

      Specified by:
      metricApproximateAgeOfOldestMessage in interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricApproximateNumberOfMessagesDelayed

      @Stability(Stable) @NotNull public Metric 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 interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricApproximateNumberOfMessagesNotVisible

      @Stability(Stable) @NotNull public Metric metricApproximateNumberOfMessagesNotVisible()
      The number of messages that are in flight.

      Maximum over 5 minutes

      Specified by:
      metricApproximateNumberOfMessagesNotVisible in interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricApproximateNumberOfMessagesVisible

      @Stability(Stable) @NotNull public Metric metricApproximateNumberOfMessagesVisible()
      The number of messages available for retrieval from the queue.

      Maximum over 5 minutes

      Specified by:
      metricApproximateNumberOfMessagesVisible in interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricNumberOfEmptyReceives

      @Stability(Stable) @NotNull public Metric metricNumberOfEmptyReceives()
      The number of ReceiveMessage API calls that did not return a message.

      Sum over 5 minutes

      Specified by:
      metricNumberOfEmptyReceives in interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricNumberOfMessagesDeleted

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesDeleted()
      The number of messages deleted from the queue.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesDeleted in interface IQueue
    • 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 interface IQueue
      Parameters:
      props -
    • metricNumberOfMessagesReceived

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesReceived()
      The number of messages returned by calls to the ReceiveMessage action.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesReceived in interface IQueue
    • metricNumberOfMessagesSent

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesSent(@Nullable MetricOptions props)
      The number of messages added to a queue.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesSent in interface IQueue
      Parameters:
      props -
    • metricNumberOfMessagesSent

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesSent()
      The number of messages added to a queue.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesSent in interface IQueue
    • metricSentMessageSize

      @Stability(Stable) @NotNull public Metric metricSentMessageSize(@Nullable MetricOptions props)
      The size of messages added to a queue.

      Average over 5 minutes

      Specified by:
      metricSentMessageSize in interface IQueue
      Parameters:
      props -
    • metricSentMessageSize

      @Stability(Stable) @NotNull public Metric metricSentMessageSize()
      The size of messages added to a queue.

      Average over 5 minutes

      Specified by:
      metricSentMessageSize in interface IQueue
    • validate

      @Stability(Stable) @NotNull protected List<String> 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.

      Overrides:
      validate in class Construct
      Returns:
      An array of validation error messages, or an empty array if the construct is valid.
    • getAutoCreatePolicy

      @Stability(Stable) @NotNull protected abstract Boolean getAutoCreatePolicy()
      Controls automatic creation of policy objects.

      Set by subclasses.

    • getFifo

      @Stability(Stable) @NotNull public abstract Boolean getFifo()
      Whether this queue is an Amazon SQS FIFO queue.

      If false, this is a standard queue.

      Specified by:
      getFifo in interface IQueue
    • getQueueArn

      @Stability(Stable) @NotNull public abstract String getQueueArn()
      The ARN of this queue.
      Specified by:
      getQueueArn in interface IQueue
    • getQueueName

      @Stability(Stable) @NotNull public abstract String getQueueName()
      The name of this queue.
      Specified by:
      getQueueName in interface IQueue
    • getQueueUrl

      @Stability(Stable) @NotNull public abstract String getQueueUrl()
      The URL of this queue.
      Specified by:
      getQueueUrl in interface IQueue
    • getEncryptionMasterKey

      @Stability(Stable) @Nullable public abstract IKey getEncryptionMasterKey()
      If this queue is server-side encrypted, this is the KMS encryption key.
      Specified by:
      getEncryptionMasterKey in interface IQueue