Class: AWSCDK::DynamoDB::TableGrants
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::DynamoDB::TableGrants
- Defined in:
- dynamo_db/table_grants.rb
Overview
A set of permissions to grant on a Table.
Class Method Summary collapse
-
.from_table(table, regions = nil, has_index = nil) ⇒ AWSCDK::DynamoDB::TableGrants
Creates a TableGrants object for a given table.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#actions(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this table to an IAM principal's policy.
-
#full_access(grantee) ⇒ AWSCDK::IAM::Grant
Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
-
#initialize(props) ⇒ TableGrants
constructor
A new instance of TableGrants.
-
#multi_account_replication_from(source_replica_arn) ⇒ void
Grants permissions for this table to act as a destination for multi-account global table replication.
-
#multi_account_replication_to(destination_replica_arn) ⇒ void
Grants permissions for this table to act as a source for multi-account global table replication.
-
#read_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
-
#read_write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal to all data read/write operations to this table.
-
#write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
Constructor Details
#initialize(props) ⇒ TableGrants
Returns a new instance of TableGrants.
9 10 11 12 13 |
# File 'dynamo_db/table_grants.rb', line 9 def initialize(props) props = props.is_a?(Hash) ? ::AWSCDK::DynamoDB::TableGrantsProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuVGFibGVHcmFudHNQcm9wcyJ9")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(props) end |
Class Method Details
.from_table(table, regions = nil, has_index = nil) ⇒ AWSCDK::DynamoDB::TableGrants
Creates a TableGrants object for a given table.
33 34 35 36 37 38 |
# File 'dynamo_db/table_grants.rb', line 33 def self.from_table(table, regions = nil, has_index = nil) Jsii::Type.check_type(table, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19keW5hbW9kYi5JVGFibGVSZWYifQ==")), "table") Jsii::Type.check_type(regions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "regions") unless regions.nil? Jsii::Type.check_type(has_index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "hasIndex") unless has_index.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_dynamodb.TableGrants", "fromTable", [table, regions, has_index]) end |
.jsii_overridable_methods ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'dynamo_db/table_grants.rb', line 15 def self.jsii_overridable_methods { :actions => { kind: :method, name: "actions", is_optional: false }, :full_access => { kind: :method, name: "fullAccess", is_optional: false }, :multi_account_replication_from => { kind: :method, name: "multiAccountReplicationFrom", is_optional: false }, :multi_account_replication_to => { kind: :method, name: "multiAccountReplicationTo", is_optional: false }, :read_data => { kind: :method, name: "readData", is_optional: false }, :read_write_data => { kind: :method, name: "readWriteData", is_optional: false }, :write_data => { kind: :method, name: "writeData", is_optional: false }, } end |
Instance Method Details
#actions(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this table to an IAM principal's policy.
If encryption_key is present, appropriate grants to the key needs to be added
separately using the table.encryptionKey.grant* methods.
48 49 50 51 52 53 54 |
# File 'dynamo_db/table_grants.rb', line 48 def actions(grantee, *actions) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") actions.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]") end jsii_call_method("actions", [grantee, *actions]) end |
#full_access(grantee) ⇒ AWSCDK::IAM::Grant
Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
63 64 65 66 |
# File 'dynamo_db/table_grants.rb', line 63 def full_access(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("fullAccess", [grantee]) end |
#multi_account_replication_from(source_replica_arn) ⇒ void
This method returns an undefined value.
Grants permissions for this table to act as a destination for multi-account global table replication.
72 73 74 75 |
# File 'dynamo_db/table_grants.rb', line 72 def multi_account_replication_from(source_replica_arn) Jsii::Type.check_type(source_replica_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceReplicaArn") jsii_call_method("multiAccountReplicationFrom", [source_replica_arn]) end |
#multi_account_replication_to(destination_replica_arn) ⇒ void
This method returns an undefined value.
Grants permissions for this table to act as a source for multi-account global table replication.
81 82 83 84 |
# File 'dynamo_db/table_grants.rb', line 81 def multi_account_replication_to(destination_replica_arn) Jsii::Type.check_type(destination_replica_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "destinationReplicaArn") jsii_call_method("multiAccountReplicationTo", [destination_replica_arn]) end |
#read_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
93 94 95 96 |
# File 'dynamo_db/table_grants.rb', line 93 def read_data(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("readData", [grantee]) end |
#read_write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal to all data read/write operations to this table.
BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
108 109 110 111 |
# File 'dynamo_db/table_grants.rb', line 108 def read_write_data(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("readWriteData", [grantee]) end |
#write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
120 121 122 123 |
# File 'dynamo_db/table_grants.rb', line 120 def write_data(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("writeData", [grantee]) end |