Class: AWSCDK::DynamoDB::TableGrantsProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dynamo_db/table_grants_props.rb

Overview

Construction properties for TableGrants.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, encrypted_resource: nil, has_index: nil, policy_resource: nil, regions: nil) ⇒ TableGrantsProps

Returns a new instance of TableGrantsProps.

Parameters:

  • table (AWSCDK::Interfaces::AWSDynamodb::ITableRef)

    The table to grant permissions on.

  • encrypted_resource (AWSCDK::IAM::IEncryptedResource, nil) (defaults to: nil)

    The encrypted resource on which actions will be allowed.

  • has_index (Boolean, nil) (defaults to: nil)

    Whether this table has indexes.

  • policy_resource (AWSCDK::IAM::IResourceWithPolicyV2, nil) (defaults to: nil)

    The resource with policy on which actions will be allowed.

  • regions (Array<String>, nil) (defaults to: nil)

    Additional regions other than the main one that this table is replicated to.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'dynamo_db/table_grants_props.rb', line 12

def initialize(table:, encrypted_resource: nil, has_index: nil, policy_resource: nil, regions: nil)
  @table = table
  Jsii::Type.check_type(@table, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19keW5hbW9kYi5JVGFibGVSZWYifQ==")), "table")
  @encrypted_resource = encrypted_resource
  Jsii::Type.check_type(@encrypted_resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklFbmNyeXB0ZWRSZXNvdXJjZSJ9")), "encryptedResource") unless @encrypted_resource.nil?
  @has_index = has_index
  Jsii::Type.check_type(@has_index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "hasIndex") unless @has_index.nil?
  @policy_resource = policy_resource
  Jsii::Type.check_type(@policy_resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSZXNvdXJjZVdpdGhQb2xpY3lWMiJ9")), "policyResource") unless @policy_resource.nil?
  @regions = regions
  Jsii::Type.check_type(@regions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "regions") unless @regions.nil?
end

Instance Attribute Details

#encrypted_resourceAWSCDK::IAM::IEncryptedResource? (readonly)

Deprecated.
  • Leave this field undefined. If the table is encrypted with a customer-managed KMS key, appropriate grants to the key will be automatically added.
Note:

Default: - A best-effort attempt will be made to discover an associated KMS key and grant permissions to it.

The encrypted resource on which actions will be allowed.



34
35
36
# File 'dynamo_db/table_grants_props.rb', line 34

def encrypted_resource
  @encrypted_resource
end

#has_indexBoolean? (readonly)

Note:

Default: false

Whether this table has indexes.

If so, permissions are granted on all table indexes as well.

Returns:

  • (Boolean, nil)


41
42
43
# File 'dynamo_db/table_grants_props.rb', line 41

def has_index
  @has_index
end

#policy_resourceAWSCDK::IAM::IResourceWithPolicyV2? (readonly)

Deprecated.
  • Leave this field undefined. A best-effort attempt will be made to discover a resource policy and add permissions to it.
Note:

Default: - A best-effort attempt will be made to discover a resource policy and add permissions to it.

The resource with policy on which actions will be allowed.



47
48
49
# File 'dynamo_db/table_grants_props.rb', line 47

def policy_resource
  @policy_resource
end

#regionsArray<String>? (readonly)

Note:

Default: - No regions

Additional regions other than the main one that this table is replicated to.

Returns:

  • (Array<String>, nil)


52
53
54
# File 'dynamo_db/table_grants_props.rb', line 52

def regions
  @regions
end

#tableAWSCDK::Interfaces::AWSDynamodb::ITableRef (readonly)

The table to grant permissions on.



28
29
30
# File 'dynamo_db/table_grants_props.rb', line 28

def table
  @table
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
62
# File 'dynamo_db/table_grants_props.rb', line 54

def self.jsii_properties
  {
    :table => "table",
    :encrypted_resource => "encryptedResource",
    :has_index => "hasIndex",
    :policy_resource => "policyResource",
    :regions => "regions",
  }
end

Instance Method Details

#to_jsiiObject



64
65
66
67
68
69
70
71
72
73
74
# File 'dynamo_db/table_grants_props.rb', line 64

def to_jsii
  result = {}
  result.merge!({
    "table" => @table,
    "encryptedResource" => @encrypted_resource,
    "hasIndex" => @has_index,
    "policyResource" => @policy_resource,
    "regions" => @regions,
  })
  result.compact
end