Class QueueGrants

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.sqs.QueueGrants
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-11-20T23:37:30.688Z") @Stability(Stable) public class QueueGrants extends software.amazon.jsii.JsiiObject
Collection of grant methods for a IQueueRef.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.sqs.*;
 import software.amazon.awscdk.interfaces.sqs.*;
 IQueueRef queueRef;
 QueueGrants queueGrants = QueueGrants.fromQueue(queueRef);
 
  • Constructor Details

    • QueueGrants

      protected QueueGrants(software.amazon.jsii.JsiiObjectRef objRef)
    • QueueGrants

      protected QueueGrants(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromQueue

      @Stability(Stable) @NotNull public static QueueGrants fromQueue(@NotNull IQueueRef resource)
      Creates grants for QueueGrants.

      Parameters:
      resource - This parameter is required.
    • consumeMessages

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

      Parameters:
      grantee - This parameter is required.
    • purge

      @Stability(Stable) @NotNull public Grant purge(@NotNull IGrantable grantee)
      Grants purge permissions.

      Parameters:
      grantee - This parameter is required.
    • sendMessages

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

      Parameters:
      grantee - This parameter is required.
    • getResource

      @Stability(Stable) @NotNull protected IQueueRef getResource()
    • getEncryptedResource

      @Stability(Stable) @Nullable protected IEncryptedResource getEncryptedResource()
    • getPolicyResource

      @Stability(Stable) @Nullable protected IResourceWithPolicyV2 getPolicyResource()