Class: AWSCDK::DynamoDB::TableAttributes
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DynamoDB::TableAttributes
- Defined in:
- dynamo_db/table_attributes.rb
Overview
Reference to a dynamodb table.
Instance Attribute Summary collapse
-
#encryption_key ⇒ AWSCDK::KMS::IKey?
readonly
KMS encryption key, if this table uses a customer-managed encryption key.
-
#global_indexes ⇒ Array<String>?
readonly
The name of the global indexes set for this Table.
-
#grant_index_permissions ⇒ Boolean?
readonly
If set to true, grant methods always grant permissions for all indexes.
-
#local_indexes ⇒ Array<String>?
readonly
The name of the local indexes set for this Table.
-
#table_arn ⇒ String?
readonly
The ARN of the dynamodb table.
-
#table_name ⇒ String?
readonly
The table name of the dynamodb table.
-
#table_stream_arn ⇒ String?
readonly
The ARN of the table's stream.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of TableAttributes.
- #to_jsii ⇒ Object
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.
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 = 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_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: - no key
KMS encryption key, if this table uses a customer-managed encryption key.
35 36 37 |
# File 'dynamo_db/table_attributes.rb', line 35 def encryption_key @encryption_key end |
#global_indexes ⇒ Array<String>? (readonly)
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.
45 46 47 |
# File 'dynamo_db/table_attributes.rb', line 45 def global_indexes @global_indexes end |
#grant_index_permissions ⇒ Boolean? (readonly)
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.
53 54 55 |
# File 'dynamo_db/table_attributes.rb', line 53 def @grant_index_permissions end |
#local_indexes ⇒ Array<String>? (readonly)
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.
63 64 65 |
# File 'dynamo_db/table_attributes.rb', line 63 def local_indexes @local_indexes end |
#table_arn ⇒ String? (readonly)
Default: - no table arn
The ARN of the dynamodb table.
One of this, or table_name, is required.
70 71 72 |
# File 'dynamo_db/table_attributes.rb', line 70 def table_arn @table_arn end |
#table_name ⇒ String? (readonly)
Default: - no table name
The table name of the dynamodb table.
One of this, or table_arn, is required.
77 78 79 |
# File 'dynamo_db/table_attributes.rb', line 77 def table_name @table_name end |
#table_stream_arn ⇒ String? (readonly)
Default: - no table stream
The ARN of the table's stream.
82 83 84 |
# File 'dynamo_db/table_attributes.rb', line 82 def table_stream_arn @table_stream_arn end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |