QueueGrants

class aws_cdk.aws_sqs.QueueGrants(*args: Any, **kwargs)

Bases: object

Collection of grant methods for a IQueueRef.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sqs as sqs
from aws_cdk.interfaces import aws_sqs as interfaces_aws_sqs

# queue_ref: interfaces_aws_sqs.IQueueRef

queue_grants = sqs.QueueGrants.from_queue(queue_ref)

Methods

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)

Return type:

Grant

purge(grantee)

Grants purge permissions.

Parameters:

grantee (IGrantable)

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)

Return type:

Grant

Static Methods

classmethod from_queue(resource)

Creates grants for QueueGrants.

Parameters:

resource (IQueueRef)

Return type:

QueueGrants