Class: AWSCDK::DynamoDB::GlobalSecondaryIndexProps
- Inherits:
-
SecondaryIndexProps
- Object
- SecondaryIndexProps
- AWSCDK::DynamoDB::GlobalSecondaryIndexProps
- Defined in:
- dynamo_db/global_secondary_index_props.rb
Overview
Properties for a global secondary index.
Instance Attribute Summary collapse
-
#contributor_insights_enabled ⇒ Boolean?
readonly
deprecated
Deprecated.
use
contributorInsightsSpecificationinstead -
#contributor_insights_specification ⇒ AWSCDK::DynamoDB::ContributorInsightsSpecification?
readonly
Whether CloudWatch contributor insights is enabled and what mode is selected.
-
#index_name ⇒ String
readonly
The name of the secondary index.
-
#max_read_request_units ⇒ Numeric?
readonly
The maximum read request units for the global secondary index.
-
#max_write_request_units ⇒ Numeric?
readonly
The maximum write request units for the global secondary index.
-
#non_key_attributes ⇒ Array<String>?
readonly
The non-key attributes that are projected into the secondary index.
-
#partition_key ⇒ AWSCDK::DynamoDB::Attribute?
readonly
Partition key attribute definition.
-
#partition_keys ⇒ Array<AWSCDK::DynamoDB::Attribute>?
readonly
Multi-attribute partition key.
-
#projection_type ⇒ AWSCDK::DynamoDB::ProjectionType?
readonly
The set of attributes that are projected into the secondary index.
-
#read_capacity ⇒ Numeric?
readonly
The read capacity for the global secondary index.
-
#sort_key ⇒ AWSCDK::DynamoDB::Attribute?
readonly
Sort key attribute definition.
-
#sort_keys ⇒ Array<AWSCDK::DynamoDB::Attribute>?
readonly
Multi-attribute sort key.
-
#warm_throughput ⇒ AWSCDK::DynamoDB::WarmThroughput?
readonly
The warm throughput configuration for the global secondary index.
-
#write_capacity ⇒ Numeric?
readonly
The write capacity for the global secondary index.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(index_name:, non_key_attributes: nil, projection_type: nil, partition_key: nil, sort_key: nil, contributor_insights_enabled: nil, contributor_insights_specification: nil, max_read_request_units: nil, max_write_request_units: nil, partition_keys: nil, read_capacity: nil, sort_keys: nil, warm_throughput: nil, write_capacity: nil) ⇒ GlobalSecondaryIndexProps
constructor
A new instance of GlobalSecondaryIndexProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(index_name:, non_key_attributes: nil, projection_type: nil, partition_key: nil, sort_key: nil, contributor_insights_enabled: nil, contributor_insights_specification: nil, max_read_request_units: nil, max_write_request_units: nil, partition_keys: nil, read_capacity: nil, sort_keys: nil, warm_throughput: nil, write_capacity: nil) ⇒ GlobalSecondaryIndexProps
Returns a new instance of GlobalSecondaryIndexProps.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'dynamo_db/global_secondary_index_props.rb', line 22 def initialize(index_name:, non_key_attributes: nil, projection_type: nil, partition_key: nil, sort_key: nil, contributor_insights_enabled: nil, contributor_insights_specification: nil, max_read_request_units: nil, max_write_request_units: nil, partition_keys: nil, read_capacity: nil, sort_keys: nil, warm_throughput: nil, write_capacity: nil) @index_name = index_name Jsii::Type.check_type(@index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexName") @non_key_attributes = non_key_attributes Jsii::Type.check_type(@non_key_attributes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "nonKeyAttributes") unless @non_key_attributes.nil? @projection_type = projection_type Jsii::Type.check_type(@projection_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuUHJvamVjdGlvblR5cGUifQ==")), "projectionType") unless @projection_type.nil? @partition_key = partition_key.is_a?(Hash) ? ::AWSCDK::DynamoDB::Attribute.new(**partition_key.transform_keys(&:to_sym)) : partition_key Jsii::Type.check_type(@partition_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQXR0cmlidXRlIn0=")), "partitionKey") unless @partition_key.nil? @sort_key = sort_key.is_a?(Hash) ? ::AWSCDK::DynamoDB::Attribute.new(**sort_key.transform_keys(&:to_sym)) : sort_key Jsii::Type.check_type(@sort_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQXR0cmlidXRlIn0=")), "sortKey") unless @sort_key.nil? @contributor_insights_enabled = contributor_insights_enabled Jsii::Type.check_type(@contributor_insights_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "contributorInsightsEnabled") unless @contributor_insights_enabled.nil? @contributor_insights_specification = contributor_insights_specification.is_a?(Hash) ? ::AWSCDK::DynamoDB::ContributorInsightsSpecification.new(**contributor_insights_specification.transform_keys(&:to_sym)) : contributor_insights_specification Jsii::Type.check_type(@contributor_insights_specification, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQ29udHJpYnV0b3JJbnNpZ2h0c1NwZWNpZmljYXRpb24ifQ==")), "contributorInsightsSpecification") unless @contributor_insights_specification.nil? @max_read_request_units = max_read_request_units Jsii::Type.check_type(@max_read_request_units, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxReadRequestUnits") unless @max_read_request_units.nil? @max_write_request_units = max_write_request_units Jsii::Type.check_type(@max_write_request_units, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxWriteRequestUnits") unless @max_write_request_units.nil? @partition_keys = partition_keys.is_a?(Array) ? partition_keys.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::DynamoDB::Attribute.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : partition_keys Jsii::Type.check_type(@partition_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5BdHRyaWJ1dGUifSwia2luZCI6ImFycmF5In19")), "partitionKeys") unless @partition_keys.nil? @read_capacity = read_capacity Jsii::Type.check_type(@read_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "readCapacity") unless @read_capacity.nil? @sort_keys = sort_keys.is_a?(Array) ? sort_keys.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::DynamoDB::Attribute.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : sort_keys Jsii::Type.check_type(@sort_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5BdHRyaWJ1dGUifSwia2luZCI6ImFycmF5In19")), "sortKeys") unless @sort_keys.nil? @warm_throughput = warm_throughput.is_a?(Hash) ? ::AWSCDK::DynamoDB::WarmThroughput.new(**warm_throughput.transform_keys(&:to_sym)) : warm_throughput Jsii::Type.check_type(@warm_throughput, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuV2FybVRocm91Z2hwdXQifQ==")), "warmThroughput") unless @warm_throughput.nil? @write_capacity = write_capacity Jsii::Type.check_type(@write_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "writeCapacity") unless @write_capacity.nil? end |
Instance Attribute Details
#contributor_insights_enabled ⇒ Boolean? (readonly)
use contributorInsightsSpecification instead
Default: false
Whether CloudWatch contributor insights is enabled for the specified global secondary index.
90 91 92 |
# File 'dynamo_db/global_secondary_index_props.rb', line 90 def contributor_insights_enabled @contributor_insights_enabled end |
#contributor_insights_specification ⇒ AWSCDK::DynamoDB::ContributorInsightsSpecification? (readonly)
Default: - contributor insights is not enabled
Whether CloudWatch contributor insights is enabled and what mode is selected.
95 96 97 |
# File 'dynamo_db/global_secondary_index_props.rb', line 95 def contributor_insights_specification @contributor_insights_specification end |
#index_name ⇒ String (readonly)
The name of the secondary index.
56 57 58 |
# File 'dynamo_db/global_secondary_index_props.rb', line 56 def index_name @index_name end |
#max_read_request_units ⇒ Numeric? (readonly)
Default: - on-demand throughput is disabled
The maximum read request units for the global secondary index.
Can only be provided if table billingMode is PAY_PER_REQUEST.
102 103 104 |
# File 'dynamo_db/global_secondary_index_props.rb', line 102 def max_read_request_units @max_read_request_units end |
#max_write_request_units ⇒ Numeric? (readonly)
Default: - on-demand throughput is disabled
The maximum write request units for the global secondary index.
Can only be provided if table billingMode is PAY_PER_REQUEST.
109 110 111 |
# File 'dynamo_db/global_secondary_index_props.rb', line 109 def max_write_request_units @max_write_request_units end |
#non_key_attributes ⇒ Array<String>? (readonly)
Default: - No additional attributes
The non-key attributes that are projected into the secondary index.
61 62 63 |
# File 'dynamo_db/global_secondary_index_props.rb', line 61 def non_key_attributes @non_key_attributes end |
#partition_key ⇒ AWSCDK::DynamoDB::Attribute? (readonly)
Default: - exactly one of partitionKey and partitionKeys must be specified.
Partition key attribute definition.
If a single field forms the partition key, you can use this field. Use the
partition_keys field if the partition key is a multi-attribute key (consists of
multiple fields).
75 76 77 |
# File 'dynamo_db/global_secondary_index_props.rb', line 75 def partition_key @partition_key end |
#partition_keys ⇒ Array<AWSCDK::DynamoDB::Attribute>? (readonly)
Default: - exactly one of partitionKey and partitionKeys must be specified.
Multi-attribute partition key.
If a single field forms the partition key, you can use either
partition_key or partition_keys to specify the partition key. Exactly
one of these must be specified.
You must use partition_keys field if the partition key is a multi-attribute key
(consists of multiple fields).
NOTE: although the name of this field makes it sound like it creates multiple keys, it does not. It defines a single key that consists of of multiple fields.
The order of fields is not important.
127 128 129 |
# File 'dynamo_db/global_secondary_index_props.rb', line 127 def partition_keys @partition_keys end |
#projection_type ⇒ AWSCDK::DynamoDB::ProjectionType? (readonly)
Default: ALL
The set of attributes that are projected into the secondary index.
66 67 68 |
# File 'dynamo_db/global_secondary_index_props.rb', line 66 def projection_type @projection_type end |
#read_capacity ⇒ Numeric? (readonly)
Default: 5
The read capacity for the global secondary index.
Can only be provided if table billingMode is Provisioned or undefined.
134 135 136 |
# File 'dynamo_db/global_secondary_index_props.rb', line 134 def read_capacity @read_capacity end |
#sort_key ⇒ AWSCDK::DynamoDB::Attribute? (readonly)
Default: - no sort key
Sort key attribute definition.
If a single field forms the sort key, you can use this field. Use the
sort_keys field if the sort key is a multi-attribute key (consists of multiple
fields).
84 85 86 |
# File 'dynamo_db/global_secondary_index_props.rb', line 84 def sort_key @sort_key end |
#sort_keys ⇒ Array<AWSCDK::DynamoDB::Attribute>? (readonly)
Default: - no sort key
Multi-attribute sort key.
If a single field forms the sort key, you can use either
sort_key or sort_keys to specify the sort key. At most one of these
may be specified.
You must use sort_keys field if the sort key is a multi-attribute key
(consists of multiple fields).
NOTE: although the name of this field makes it sound like it creates multiple keys, it does not. It defines a single key that consists of of multiple fields at the same time.
NOTE: The order of fields is important!
152 153 154 |
# File 'dynamo_db/global_secondary_index_props.rb', line 152 def sort_keys @sort_keys end |
#warm_throughput ⇒ AWSCDK::DynamoDB::WarmThroughput? (readonly)
Default: - no warm throughput is configured
The warm throughput configuration for the global secondary index.
157 158 159 |
# File 'dynamo_db/global_secondary_index_props.rb', line 157 def warm_throughput @warm_throughput end |
#write_capacity ⇒ Numeric? (readonly)
Default: 5
The write capacity for the global secondary index.
Can only be provided if table billingMode is Provisioned or undefined.
164 165 166 |
# File 'dynamo_db/global_secondary_index_props.rb', line 164 def write_capacity @write_capacity end |
Class Method Details
.jsii_properties ⇒ Object
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'dynamo_db/global_secondary_index_props.rb', line 166 def self.jsii_properties { :index_name => "indexName", :non_key_attributes => "nonKeyAttributes", :projection_type => "projectionType", :partition_key => "partitionKey", :sort_key => "sortKey", :contributor_insights_enabled => "contributorInsightsEnabled", :contributor_insights_specification => "contributorInsightsSpecification", :max_read_request_units => "maxReadRequestUnits", :max_write_request_units => "maxWriteRequestUnits", :partition_keys => "partitionKeys", :read_capacity => "readCapacity", :sort_keys => "sortKeys", :warm_throughput => "warmThroughput", :write_capacity => "writeCapacity", } end |
Instance Method Details
#to_jsii ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'dynamo_db/global_secondary_index_props.rb', line 185 def to_jsii result = {} result.merge!(super) result.merge!({ "indexName" => @index_name, "nonKeyAttributes" => @non_key_attributes, "projectionType" => @projection_type, "partitionKey" => @partition_key, "sortKey" => @sort_key, "contributorInsightsEnabled" => @contributor_insights_enabled, "contributorInsightsSpecification" => @contributor_insights_specification, "maxReadRequestUnits" => @max_read_request_units, "maxWriteRequestUnits" => @max_write_request_units, "partitionKeys" => @partition_keys, "readCapacity" => @read_capacity, "sortKeys" => @sort_keys, "warmThroughput" => @warm_throughput, "writeCapacity" => @write_capacity, }) result.compact end |