interface GlobalSecondaryIndexPropsV2
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.DynamoDB.GlobalSecondaryIndexPropsV2 |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#GlobalSecondaryIndexPropsV2 |
![]() | software.amazon.awscdk.services.dynamodb.GlobalSecondaryIndexPropsV2 |
![]() | aws_cdk.aws_dynamodb.GlobalSecondaryIndexPropsV2 |
![]() | aws-cdk-lib » aws_dynamodb » GlobalSecondaryIndexPropsV2 |
Properties used to configure a global secondary index.
Example
const table = new dynamodb.TableV2(this, 'Table', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
globalSecondaryIndexes: [
{
indexName: 'gsi1',
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
},
],
});
table.addGlobalSecondaryIndex({
indexName: 'gsi2',
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
});
Properties
Name | Type | Description |
---|---|---|
index | string | The name of the secondary index. |
partition | Attribute | Partition key attribute definition. |
max | number | The maximum read request units. |
max | number | The maximum write request units. |
non | string[] | The non-key attributes that are projected into the secondary index. |
projection | Projection | The set of attributes that are projected into the secondary index. |
read | Capacity | The read capacity. |
sort | Attribute | Sort key attribute definition. |
warm | Warm | The warm throughput configuration for the global secondary index. |
write | Capacity | The write capacity. |
indexName
Type:
string
The name of the secondary index.
partitionKey
Type:
Attribute
Partition key attribute definition.
maxReadRequestUnits?
Type:
number
(optional, default: inherited from the primary table.)
The maximum read request units.
Note: This can only be configured if the primary table billing is PAY_PER_REQUEST.
maxWriteRequestUnits?
Type:
number
(optional, default: inherited from the primary table.)
The maximum write request units.
Note: This can only be configured if the primary table billing is PAY_PER_REQUEST.
nonKeyAttributes?
Type:
string[]
(optional, default: No additional attributes)
The non-key attributes that are projected into the secondary index.
projectionType?
Type:
Projection
(optional, default: ALL)
The set of attributes that are projected into the secondary index.
readCapacity?
Type:
Capacity
(optional, default: inherited from the primary table.)
The read capacity.
Note: This can only be configured if the primary table billing is provisioned.
sortKey?
Type:
Attribute
(optional, default: no sort key)
Sort key attribute definition.
warmThroughput?
Type:
Warm
(optional, default: no warm throughput is configured)
The warm throughput configuration for the global secondary index.
writeCapacity?
Type:
Capacity
(optional, default: inherited from the primary table.)
The write capacity.
Note: This can only be configured if the primary table billing is provisioned.