Class: AWSCDK::SQS::QueueGrants
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::SQS::QueueGrants
- Defined in:
- sqs/queue_grants.rb
Overview
Collection of grant methods for a IQueueRef.
Class Method Summary collapse
-
.from_queue(resource) ⇒ AWSCDK::SQS::QueueGrants
Creates grants for QueueGrants.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant
Grant the given identity custom permissions.
-
#consume_messages(grantee) ⇒ AWSCDK::IAM::Grant
Grant permissions to consume messages from a queue.
- #encrypted_resource ⇒ AWSCDK::IAM::IEncryptedResource?
-
#initialize(*args) ⇒ QueueGrants
constructor
A new instance of QueueGrants.
- #policy_resource ⇒ AWSCDK::IAM::IResourceWithPolicyV2?
-
#purge(grantee) ⇒ AWSCDK::IAM::Grant
Grants purge permissions.
- #resource ⇒ AWSCDK::Interfaces::AWSSQS::IQueueRef
-
#send_messages(grantee) ⇒ AWSCDK::IAM::Grant
Grant access to send messages to a queue to the given identity.
Constructor Details
#initialize(*args) ⇒ QueueGrants
Returns a new instance of QueueGrants.
8 9 10 |
# File 'sqs/queue_grants.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_sqs.QueueGrants does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.from_queue(resource) ⇒ AWSCDK::SQS::QueueGrants
Creates grants for QueueGrants.
28 29 30 31 |
# File 'sqs/queue_grants.rb', line 28 def self.from_queue(resource) Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zcXMuSVF1ZXVlUmVmIn0=")), "resource") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_sqs.QueueGrants", "fromQueue", [resource]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'sqs/queue_grants.rb', line 12 def self.jsii_overridable_methods { :resource => { kind: :property, name: "resource", is_optional: false }, :encrypted_resource => { kind: :property, name: "encryptedResource", is_optional: true }, :policy_resource => { kind: :property, name: "policyResource", is_optional: true }, :actions => { kind: :method, name: "actions", is_optional: false }, :consume_messages => { kind: :method, name: "consumeMessages", is_optional: false }, :purge => { kind: :method, name: "purge", is_optional: false }, :send_messages => { kind: :method, name: "sendMessages", is_optional: false }, } end |
Instance Method Details
#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant
Grant the given identity custom permissions.
54 55 56 57 58 59 60 |
# File 'sqs/queue_grants.rb', line 54 def actions(grantee, actions, = nil) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") Jsii::Type.check_type(actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions") = .is_a?(Hash) ? ::AWSCDK::EncryptedPermissionsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5FbmNyeXB0ZWRQZXJtaXNzaW9uc09wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("actions", [grantee, actions, ]) end |
#consume_messages(grantee) ⇒ AWSCDK::IAM::Grant
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
80 81 82 83 |
# File 'sqs/queue_grants.rb', line 80 def (grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("consumeMessages", [grantee]) end |
#encrypted_resource ⇒ AWSCDK::IAM::IEncryptedResource?
39 40 41 |
# File 'sqs/queue_grants.rb', line 39 def encrypted_resource() jsii_get_property("encryptedResource") end |
#policy_resource ⇒ AWSCDK::IAM::IResourceWithPolicyV2?
44 45 46 |
# File 'sqs/queue_grants.rb', line 44 def policy_resource() jsii_get_property("policyResource") end |
#purge(grantee) ⇒ AWSCDK::IAM::Grant
Grants purge permissions.
89 90 91 92 |
# File 'sqs/queue_grants.rb', line 89 def purge(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("purge", [grantee]) end |
#resource ⇒ AWSCDK::Interfaces::AWSSQS::IQueueRef
34 35 36 |
# File 'sqs/queue_grants.rb', line 34 def resource() jsii_get_property("resource") end |
#send_messages(grantee) ⇒ AWSCDK::IAM::Grant
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*
113 114 115 116 |
# File 'sqs/queue_grants.rb', line 113 def (grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("sendMessages", [grantee]) end |