Class: AWSCDK::DynamoDB::TableAttributes

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

Overview

Reference to 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_name: nil, table_stream_arn: nil) ⇒ TableAttributes

Returns a new instance of TableAttributes.

Parameters:

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

    KMS encryption key, if this table uses a customer-managed encryption key.

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

    The name of the global indexes set for this Table.

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

    If set to true, grant methods always grant permissions for all indexes.

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

    The name of the local indexes set for this Table.

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

    The ARN of the dynamodb table.

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

    The table name of the dynamodb table.

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

    The ARN of the table's stream.



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

def initialize(encryption_key: nil, global_indexes: nil, grant_index_permissions: nil, local_indexes: nil, table_arn: 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_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 key

KMS encryption key, if this table uses a customer-managed encryption key.

Returns:



35
36
37
# File 'dynamo_db/table_attributes.rb', line 35

def encryption_key
  @encryption_key
end

#global_indexesArray<String>? (readonly)

Note:

Default: - no global indexes

The name of the global indexes set for this Table.

Note that you need to set either this property, or local_indexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.

Returns:

  • (Array<String>, nil)


45
46
47
# File 'dynamo_db/table_attributes.rb', line 45

def global_indexes
  @global_indexes
end

#grant_index_permissionsBoolean? (readonly)

Note:

Default: - false

If set to true, grant methods always grant permissions for all indexes.

If false is provided, grant methods grant the permissions only when global_indexes or local_indexes is specified.

Returns:

  • (Boolean, nil)


53
54
55
# File 'dynamo_db/table_attributes.rb', line 53

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 this Table.

Note that you need to set either this property, or global_indexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.

Returns:

  • (Array<String>, nil)


63
64
65
# File 'dynamo_db/table_attributes.rb', line 63

def local_indexes
  @local_indexes
end

#table_arnString? (readonly)

Note:

Default: - no table arn

The ARN of the dynamodb table.

One of this, or table_name, is required.

Returns:

  • (String, nil)


70
71
72
# File 'dynamo_db/table_attributes.rb', line 70

def table_arn
  @table_arn
end

#table_nameString? (readonly)

Note:

Default: - no table name

The table name of the dynamodb table.

One of this, or table_arn, is required.

Returns:

  • (String, nil)


77
78
79
# File 'dynamo_db/table_attributes.rb', line 77

def table_name
  @table_name
end

#table_stream_arnString? (readonly)

Note:

Default: - no table stream

The ARN of the table's stream.

Returns:

  • (String, nil)


82
83
84
# File 'dynamo_db/table_attributes.rb', line 82

def table_stream_arn
  @table_stream_arn
end

Class Method Details

.jsii_propertiesObject



84
85
86
87
88
89
90
91
92
93
94
# File 'dynamo_db/table_attributes.rb', line 84

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

Instance Method Details

#to_jsiiObject



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'dynamo_db/table_attributes.rb', line 96

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