Class QueueBase

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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:14.202Z") @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

      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

      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

      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*

      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
    • 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
    • getEncryptionType

      @Stability(Stable) @Nullable public abstract QueueEncryption getEncryptionType()
      Whether the contents of the queue are encrypted, and by what type of key.
      Specified by:
      getEncryptionType in interface IQueue