QueueGrants Facade
Collection of grant methods for a IQueueRef.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sqs as sqs } from 'aws-cdk-lib';
import { aws_sqs as interfaces_sqs } from 'aws-cdk-lib/interfaces';
declare const queueRef: interfaces_sqs.IQueueRef;
const queueGrants = sqs.QueueGrants.fromQueue(queueRef);
python
# 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_sqs
# queue_ref: interfaces_sqs.IQueueRef
queue_grants = sqs.QueueGrants.from_queue(queue_ref)
java
// 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);
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SQS;
using Amazon.CDK.Interfaces.SQS;
IQueueRef queueRef;
var queueGrants = QueueGrants.FromQueue(queueRef);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var queueRef IQueueRef
queueGrants := awscdk.Aws_sqs.QueueGrants_FromQueue(queueRef)
Methods
actions(grantee: IGrantable, actions: string[], options?: EncryptedPermissionsOptions): Grantdef actions(self, grantee: IGrantable, actions: typing.List[str], options: typing.Optional[EncryptedPermissionsOptions] = None) -> Grantpublic Grant actions(IGrantable grantee, List<String> actions, EncryptedPermissionsOptions options)public Grant Actions(IGrantable grantee, string[] actions, EncryptedPermissionsOptions? options = null)func Actions(Grantee IGrantable, Actions *[]*string, Options EncryptedPermissionsOptions) Grant #Grant the given identity custom permissions.
consumeMessages(grantee: IGrantable): Grantdef consume_messages(self, grantee: IGrantable) -> Grantpublic Grant consumeMessages(IGrantable grantee)public Grant ConsumeMessages(IGrantable grantee)func ConsumeMessages(Grantee IGrantable) Grant #Grant permissions to consume messages from a queue.
notes
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
fromQueue(resource: IQueueRef): QueueGrants // chainable@staticmethod def from_queue(resource: IQueueRef) -> QueueGrantspublic static QueueGrants fromQueue(IQueueRef resource)public static QueueGrants FromQueue(IQueueRef resource)func FromQueue(Resource IQueueRef) QueueGrants static #Creates grants for QueueGrants.
purge(grantee: IGrantable): Grantdef purge(self, grantee: IGrantable) -> Grantpublic Grant purge(IGrantable grantee)public Grant Purge(IGrantable grantee)func Purge(Grantee IGrantable) Grant #Grants purge permissions.
sendMessages(grantee: IGrantable): Grantdef send_messages(self, grantee: IGrantable) -> Grantpublic Grant sendMessages(IGrantable grantee)public Grant SendMessages(IGrantable grantee)func SendMessages(Grantee IGrantable) Grant #Grant access to send messages to a queue to the given identity.
notes
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*