Interface GlobalSecondaryIndexPropsV2
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,SecondaryIndexProps
- All Known Implementing Classes:
GlobalSecondaryIndexPropsV2.Jsii$Proxy
Example:
TableV2 table = TableV2.Builder.create(this, "Table")
.partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
.globalSecondaryIndexes(List.of(GlobalSecondaryIndexPropsV2.builder()
.indexName("gsi1")
.partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
.build()))
.build();
table.addGlobalSecondaryIndex(GlobalSecondaryIndexPropsV2.builder()
.indexName("gsi2")
.partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
.build());
// Add a GSI with multi-attribute keys
table.addGlobalSecondaryIndex(GlobalSecondaryIndexPropsV2.builder()
.indexName("multi-attribute-gsi2")
.partitionKeys(List.of(Attribute.builder().name("multi-attribute_pk1").type(AttributeType.STRING).build(), Attribute.builder().name("multi-attribute_pk2").type(AttributeType.NUMBER).build()))
.sortKey(Attribute.builder().name("sk").type(AttributeType.STRING).build())
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forGlobalSecondaryIndexPropsV2static final classAn implementation forGlobalSecondaryIndexPropsV2 -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default NumberThe maximum read request units.default NumberThe maximum write request units.default AttributePartition key attribute definition.Multi-attribute partition key.default CapacityThe read capacity.default AttributeSort key attribute definition.Multi-attribute sort key.default WarmThroughputThe warm throughput configuration for the global secondary index.default CapacityThe write capacity.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.dynamodb.SecondaryIndexProps
getIndexName, getNonKeyAttributes, getProjectionType
-
Method Details
-
getMaxReadRequestUnits
The maximum read request units.Note: This can only be configured if the primary table billing is PAY_PER_REQUEST.
Default: - inherited from the primary table.
-
getMaxWriteRequestUnits
The maximum write request units.Note: This can only be configured if the primary table billing is PAY_PER_REQUEST.
Default: - inherited from the primary table.
-
getPartitionKey
Partition key attribute definition.If a single field forms the partition key, you can use this field. Use the
partitionKeysfield if the partition key is a multi-attribute key (consists of multiple fields).Default: - exactly one of `partitionKey` and `partitionKeys` must be specified.
-
getPartitionKeys
Multi-attribute partition key.If a single field forms the partition key, you can use either
partitionKeyorpartitionKeysto specify the partition key. Exactly one of these must be specified.You must use
partitionKeysfield 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.
Default: - exactly one of `partitionKey` and `partitionKeys` must be specified.
-
getReadCapacity
The read capacity.Note: This can only be configured if the primary table billing is provisioned.
Default: - inherited from the primary table.
-
getSortKey
Sort key attribute definition.If a single field forms the sort key, you can use this field. Use the
sortKeysfield if the sort key is a multi-attribute key (consists of multiple fields).Default: - no sort key
-
getSortKeys
Multi-attribute sort key.If a single field forms the sort key, you can use either
sortKeyorsortKeysto specify the sort key. At most one of these may be specified.You must use
sortKeysfield 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!
Default: - no sort key
-
getWarmThroughput
The warm throughput configuration for the global secondary index.Default: - no warm throughput is configured
-
getWriteCapacity
The write capacity.Note: This can only be configured if the primary table billing is provisioned.
Default: - inherited from the primary table.
-
builder
-