Class: AWSCDK::DynamoDB::CfnGlobalTable::GlobalSecondaryIndexProperty

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

Overview

Allows you to specify a global secondary index for the global table.

The index will be defined on all replicas.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index_name:, key_schema:, projection:, read_on_demand_throughput_settings: nil, read_provisioned_throughput_settings: nil, warm_throughput: nil, write_on_demand_throughput_settings: nil, write_provisioned_throughput_settings: nil) ⇒ GlobalSecondaryIndexProperty

Returns a new instance of GlobalSecondaryIndexProperty.

Parameters:



1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'dynamo_db/cfn_global_table.rb', line 1004

def initialize(index_name:, key_schema:, projection:, read_on_demand_throughput_settings: nil, read_provisioned_throughput_settings: nil, warm_throughput: nil, write_on_demand_throughput_settings: nil, write_provisioned_throughput_settings: nil)
  @index_name = index_name
  Jsii::Type.check_type(@index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexName")
  @key_schema = key_schema
  Jsii::Type.check_type(@key_schema, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQ2ZuR2xvYmFsVGFibGUuS2V5U2NoZW1hUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "keySchema")
  @projection = projection.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::ProjectionProperty.new(**projection.transform_keys(&:to_sym)) : projection
  Jsii::Type.check_type(@projection, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5Qcm9qZWN0aW9uUHJvcGVydHkifV19fQ==")), "projection")
  @read_on_demand_throughput_settings = read_on_demand_throughput_settings.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::ReadOnDemandThroughputSettingsProperty.new(**read_on_demand_throughput_settings.transform_keys(&:to_sym)) : read_on_demand_throughput_settings
  Jsii::Type.check_type(@read_on_demand_throughput_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5SZWFkT25EZW1hbmRUaHJvdWdocHV0U2V0dGluZ3NQcm9wZXJ0eSJ9XX19")), "readOnDemandThroughputSettings") unless @read_on_demand_throughput_settings.nil?
  @read_provisioned_throughput_settings = read_provisioned_throughput_settings.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::GlobalReadProvisionedThroughputSettingsProperty.new(**read_provisioned_throughput_settings.transform_keys(&:to_sym)) : read_provisioned_throughput_settings
  Jsii::Type.check_type(@read_provisioned_throughput_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5HbG9iYWxSZWFkUHJvdmlzaW9uZWRUaHJvdWdocHV0U2V0dGluZ3NQcm9wZXJ0eSJ9XX19")), "readProvisionedThroughputSettings") unless @read_provisioned_throughput_settings.nil?
  @warm_throughput = warm_throughput.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::WarmThroughputProperty.new(**warm_throughput.transform_keys(&:to_sym)) : warm_throughput
  Jsii::Type.check_type(@warm_throughput, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5XYXJtVGhyb3VnaHB1dFByb3BlcnR5In1dfX0=")), "warmThroughput") unless @warm_throughput.nil?
  @write_on_demand_throughput_settings = write_on_demand_throughput_settings.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::WriteOnDemandThroughputSettingsProperty.new(**write_on_demand_throughput_settings.transform_keys(&:to_sym)) : write_on_demand_throughput_settings
  Jsii::Type.check_type(@write_on_demand_throughput_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5Xcml0ZU9uRGVtYW5kVGhyb3VnaHB1dFNldHRpbmdzUHJvcGVydHkifV19fQ==")), "writeOnDemandThroughputSettings") unless @write_on_demand_throughput_settings.nil?
  @write_provisioned_throughput_settings = write_provisioned_throughput_settings.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::WriteProvisionedThroughputSettingsProperty.new(**write_provisioned_throughput_settings.transform_keys(&:to_sym)) : write_provisioned_throughput_settings
  Jsii::Type.check_type(@write_provisioned_throughput_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5Xcml0ZVByb3Zpc2lvbmVkVGhyb3VnaHB1dFNldHRpbmdzUHJvcGVydHkifV19fQ==")), "writeProvisionedThroughputSettings") unless @write_provisioned_throughput_settings.nil?
end

Instance Attribute Details

#index_nameString (readonly)

The name of the global secondary index.

The name must be unique among all other indexes on this table.



1029
1030
1031
# File 'dynamo_db/cfn_global_table.rb', line 1029

def index_name
  @index_name
end

#key_schemaAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::DynamoDB::CfnGlobalTable::KeySchemaProperty> (readonly)

The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: - HASH - partition key - RANGE - sort key > The partition key of an item is also known as its hash attribute .

The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.

The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.



1038
1039
1040
# File 'dynamo_db/cfn_global_table.rb', line 1038

def key_schema
  @key_schema
end

#projectionAWSCDK::IResolvable, AWSCDK::DynamoDB::CfnGlobalTable::ProjectionProperty (readonly)

Represents attributes that are copied (projected) from the table into the global secondary index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.



1045
1046
1047
# File 'dynamo_db/cfn_global_table.rb', line 1045

def projection
  @projection
end

#read_on_demand_throughput_settingsAWSCDK::IResolvable, ... (readonly)



1048
1049
1050
# File 'dynamo_db/cfn_global_table.rb', line 1048

def read_on_demand_throughput_settings
  @read_on_demand_throughput_settings
end

#read_provisioned_throughput_settingsAWSCDK::IResolvable, ... (readonly)



1051
1052
1053
# File 'dynamo_db/cfn_global_table.rb', line 1051

def read_provisioned_throughput_settings
  @read_provisioned_throughput_settings
end

#warm_throughputAWSCDK::IResolvable, ... (readonly)

Represents the warm throughput value (in read units per second and write units per second) for the specified secondary index.

If you use this parameter, you must specify ReadUnitsPerSecond , WriteUnitsPerSecond , or both.



1058
1059
1060
# File 'dynamo_db/cfn_global_table.rb', line 1058

def warm_throughput
  @warm_throughput
end

#write_on_demand_throughput_settingsAWSCDK::IResolvable, ... (readonly)

Sets the write request settings for a global table or a global secondary index.

You can only specify this setting if your resource uses the PAY_PER_REQUEST BillingMode .



1065
1066
1067
# File 'dynamo_db/cfn_global_table.rb', line 1065

def write_on_demand_throughput_settings
  @write_on_demand_throughput_settings
end

#write_provisioned_throughput_settingsAWSCDK::IResolvable, ... (readonly)

Defines write capacity settings for the global secondary index.

You must specify a value for this property if the table's BillingMode is PROVISIONED . All replicas will have the same write capacity settings for this global secondary index.



1072
1073
1074
# File 'dynamo_db/cfn_global_table.rb', line 1072

def write_provisioned_throughput_settings
  @write_provisioned_throughput_settings
end

Class Method Details

.jsii_propertiesObject



1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
# File 'dynamo_db/cfn_global_table.rb', line 1074

def self.jsii_properties
  {
    :index_name => "indexName",
    :key_schema => "keySchema",
    :projection => "projection",
    :read_on_demand_throughput_settings => "readOnDemandThroughputSettings",
    :read_provisioned_throughput_settings => "readProvisionedThroughputSettings",
    :warm_throughput => "warmThroughput",
    :write_on_demand_throughput_settings => "writeOnDemandThroughputSettings",
    :write_provisioned_throughput_settings => "writeProvisionedThroughputSettings",
  }
end

Instance Method Details

#to_jsiiObject



1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'dynamo_db/cfn_global_table.rb', line 1087

def to_jsii
  result = {}
  result.merge!({
    "indexName" => @index_name,
    "keySchema" => @key_schema,
    "projection" => @projection,
    "readOnDemandThroughputSettings" => @read_on_demand_throughput_settings,
    "readProvisionedThroughputSettings" => @read_provisioned_throughput_settings,
    "warmThroughput" => @warm_throughput,
    "writeOnDemandThroughputSettings" => @write_on_demand_throughput_settings,
    "writeProvisionedThroughputSettings" => @write_provisioned_throughput_settings,
  })
  result.compact
end