Class: AWSCDK::DynamoDB::CfnTable::GlobalSecondaryIndexProperty

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

Overview

Represents the properties of a global secondary index.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index_name:, key_schema:, projection:, contributor_insights_specification: nil, on_demand_throughput: nil, provisioned_throughput: nil, warm_throughput: nil) ⇒ GlobalSecondaryIndexProperty

Returns a new instance of GlobalSecondaryIndexProperty.

Parameters:



964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'dynamo_db/cfn_table.rb', line 964

def initialize(index_name:, key_schema:, projection:, contributor_insights_specification: nil, on_demand_throughput: nil, provisioned_throughput: nil, warm_throughput: 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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQ2ZuVGFibGUuS2V5U2NoZW1hUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "keySchema")
  @projection = projection.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::ProjectionProperty.new(**projection.transform_keys(&:to_sym)) : projection
  Jsii::Type.check_type(@projection, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5Qcm9qZWN0aW9uUHJvcGVydHkifV19fQ==")), "projection")
  @contributor_insights_specification = contributor_insights_specification.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::ContributorInsightsSpecificationProperty.new(**contributor_insights_specification.transform_keys(&:to_sym)) : contributor_insights_specification
  Jsii::Type.check_type(@contributor_insights_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5Db250cmlidXRvckluc2lnaHRzU3BlY2lmaWNhdGlvblByb3BlcnR5In1dfX0=")), "contributorInsightsSpecification") unless @contributor_insights_specification.nil?
  @on_demand_throughput = on_demand_throughput.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::OnDemandThroughputProperty.new(**on_demand_throughput.transform_keys(&:to_sym)) : on_demand_throughput
  Jsii::Type.check_type(@on_demand_throughput, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5PbkRlbWFuZFRocm91Z2hwdXRQcm9wZXJ0eSJ9XX19")), "onDemandThroughput") unless @on_demand_throughput.nil?
  @provisioned_throughput = provisioned_throughput.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::ProvisionedThroughputProperty.new(**provisioned_throughput.transform_keys(&:to_sym)) : provisioned_throughput
  Jsii::Type.check_type(@provisioned_throughput, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5Qcm92aXNpb25lZFRocm91Z2hwdXRQcm9wZXJ0eSJ9XX19")), "provisionedThroughput") unless @provisioned_throughput.nil?
  @warm_throughput = warm_throughput.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::WarmThroughputProperty.new(**warm_throughput.transform_keys(&:to_sym)) : warm_throughput
  Jsii::Type.check_type(@warm_throughput, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5XYXJtVGhyb3VnaHB1dFByb3BlcnR5In1dfX0=")), "warmThroughput") unless @warm_throughput.nil?
end

Instance Attribute Details

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

The settings used to specify whether to enable CloudWatch Contributor Insights for the global table and define which events to monitor.



1008
1009
1010
# File 'dynamo_db/cfn_table.rb', line 1008

def contributor_insights_specification
  @contributor_insights_specification
end

#index_nameString (readonly)

The name of the global secondary index.

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



987
988
989
# File 'dynamo_db/cfn_table.rb', line 987

def index_name
  @index_name
end

#key_schemaAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::DynamoDB::CfnTable::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.



996
997
998
# File 'dynamo_db/cfn_table.rb', line 996

def key_schema
  @key_schema
end

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

The maximum number of read and write units for the specified global secondary index.

If you use this parameter, you must specify MaxReadRequestUnits , MaxWriteRequestUnits , or both. You must use either OnDemandThroughput or ProvisionedThroughput based on your table's capacity mode.



1015
1016
1017
# File 'dynamo_db/cfn_table.rb', line 1015

def on_demand_throughput
  @on_demand_throughput
end

#projectionAWSCDK::IResolvable, AWSCDK::DynamoDB::CfnTable::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.



1003
1004
1005
# File 'dynamo_db/cfn_table.rb', line 1003

def projection
  @projection
end

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

Represents the provisioned throughput settings for the specified global secondary index.

You must use either OnDemandThroughput or ProvisionedThroughput based on your table's capacity mode.

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide .



1024
1025
1026
# File 'dynamo_db/cfn_table.rb', line 1024

def provisioned_throughput
  @provisioned_throughput
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.



1031
1032
1033
# File 'dynamo_db/cfn_table.rb', line 1031

def warm_throughput
  @warm_throughput
end

Class Method Details

.jsii_propertiesObject



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'dynamo_db/cfn_table.rb', line 1033

def self.jsii_properties
  {
    :index_name => "indexName",
    :key_schema => "keySchema",
    :projection => "projection",
    :contributor_insights_specification => "contributorInsightsSpecification",
    :on_demand_throughput => "onDemandThroughput",
    :provisioned_throughput => "provisionedThroughput",
    :warm_throughput => "warmThroughput",
  }
end

Instance Method Details

#to_jsiiObject



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'dynamo_db/cfn_table.rb', line 1045

def to_jsii
  result = {}
  result.merge!({
    "indexName" => @index_name,
    "keySchema" => @key_schema,
    "projection" => @projection,
    "contributorInsightsSpecification" => @contributor_insights_specification,
    "onDemandThroughput" => @on_demand_throughput,
    "provisionedThroughput" => @provisioned_throughput,
    "warmThroughput" => @warm_throughput,
  })
  result.compact
end