Class: AWSCDK::DynamoDB::TableAttributesV2

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

Overview

Attributes of a DynamoDB table.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encryption_key: nil, global_indexes: nil, grant_index_permissions: nil, local_indexes: nil, table_arn: nil, table_id: nil, table_name: nil, table_stream_arn: nil) ⇒ TableAttributesV2

Returns a new instance of TableAttributesV2.

Parameters:

  • encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    KMS encryption key for the table.

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

    The name of the global indexes set for the table.

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

    Whether or not to grant permissions for all indexes of the table.

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

    The name of the local indexes set for the table.

  • table_arn (String, nil) (defaults to: nil)

    The ARN of the table.

  • table_id (String, nil) (defaults to: nil)

    The ID of the table.

  • table_name (String, nil) (defaults to: nil)

    The name of the table.

  • table_stream_arn (String, nil) (defaults to: nil)

    The stream ARN of the table.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'dynamo_db/table_attributes_v2.rb', line 15

def initialize(encryption_key: nil, global_indexes: nil, grant_index_permissions: nil, local_indexes: nil, table_arn: nil, table_id: nil, table_name: nil, table_stream_arn: nil)
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil?
  @global_indexes = global_indexes
  Jsii::Type.check_type(@global_indexes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "globalIndexes") unless @global_indexes.nil?
  @grant_index_permissions = grant_index_permissions
  Jsii::Type.check_type(@grant_index_permissions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "grantIndexPermissions") unless @grant_index_permissions.nil?
  @local_indexes = local_indexes
  Jsii::Type.check_type(@local_indexes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "localIndexes") unless @local_indexes.nil?
  @table_arn = table_arn
  Jsii::Type.check_type(@table_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tableArn") unless @table_arn.nil?
  @table_id = table_id
  Jsii::Type.check_type(@table_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tableId") unless @table_id.nil?
  @table_name = table_name
  Jsii::Type.check_type(@table_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tableName") unless @table_name.nil?
  @table_stream_arn = table_stream_arn
  Jsii::Type.check_type(@table_stream_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tableStreamArn") unless @table_stream_arn.nil?
end

Instance Attribute Details

#encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - no KMS encryption key

KMS encryption key for the table.

Returns:



38
39
40
# File 'dynamo_db/table_attributes_v2.rb', line 38

def encryption_key
  @encryption_key
end

#global_indexesArray<String>? (readonly)

Note:

Default: - no global indexes

The name of the global indexes set for the table.

Note: You must set either this property or local_indexes if you want permissions to be granted for indexes as well as the table itself.

Returns:

  • (Array<String>, nil)


46
47
48
# File 'dynamo_db/table_attributes_v2.rb', line 46

def global_indexes
  @global_indexes
end

#grant_index_permissionsBoolean? (readonly)

Note:

Default: false

Whether or not to grant permissions for all indexes of the table.

Note: If false, permissions will only be granted to indexes when global_indexes or local_indexes is specified.

Returns:

  • (Boolean, nil)


54
55
56
# File 'dynamo_db/table_attributes_v2.rb', line 54

def grant_index_permissions
  @grant_index_permissions
end

#local_indexesArray<String>? (readonly)

Note:

Default: - no local indexes

The name of the local indexes set for the table.

Note: You must set either this property or global_indexes if you want permissions to be granted for indexes as well as the table itself.

Returns:

  • (Array<String>, nil)


62
63
64
# File 'dynamo_db/table_attributes_v2.rb', line 62

def local_indexes
  @local_indexes
end

#table_arnString? (readonly)

Note:

Default: - table arn generated using tableName and region of stack

The ARN of the table.

Note: You must specify this or the table_name.

Returns:

  • (String, nil)


69
70
71
# File 'dynamo_db/table_attributes_v2.rb', line 69

def table_arn
  @table_arn
end

#table_idString? (readonly)

Note:

Default: - no table id

The ID of the table.

Returns:

  • (String, nil)


74
75
76
# File 'dynamo_db/table_attributes_v2.rb', line 74

def table_id
  @table_id
end

#table_nameString? (readonly)

Note:

Default: - table name retrieved from provided tableArn

The name of the table.

Note: You must specify this or the table_arn.

Returns:

  • (String, nil)


81
82
83
# File 'dynamo_db/table_attributes_v2.rb', line 81

def table_name
  @table_name
end

#table_stream_arnString? (readonly)

Note:

Default: - no table stream ARN

The stream ARN of the table.

Returns:

  • (String, nil)


86
87
88
# File 'dynamo_db/table_attributes_v2.rb', line 86

def table_stream_arn
  @table_stream_arn
end

Class Method Details

.jsii_propertiesObject



88
89
90
91
92
93
94
95
96
97
98
99
# File 'dynamo_db/table_attributes_v2.rb', line 88

def self.jsii_properties
  {
    :encryption_key => "encryptionKey",
    :global_indexes => "globalIndexes",
    :grant_index_permissions => "grantIndexPermissions",
    :local_indexes => "localIndexes",
    :table_arn => "tableArn",
    :table_id => "tableId",
    :table_name => "tableName",
    :table_stream_arn => "tableStreamArn",
  }
end

Instance Method Details

#to_jsiiObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'dynamo_db/table_attributes_v2.rb', line 101

def to_jsii
  result = {}
  result.merge!({
    "encryptionKey" => @encryption_key,
    "globalIndexes" => @global_indexes,
    "grantIndexPermissions" => @grant_index_permissions,
    "localIndexes" => @local_indexes,
    "tableArn" => @table_arn,
    "tableId" => @table_id,
    "tableName" => @table_name,
    "tableStreamArn" => @table_stream_arn,
  })
  result.compact
end