interface GlobalSecondaryIndexProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.DynamoDB.GlobalSecondaryIndexProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#GlobalSecondaryIndexProps |
Java | software.amazon.awscdk.services.dynamodb.GlobalSecondaryIndexProps |
Python | aws_cdk.aws_dynamodb.GlobalSecondaryIndexProps |
TypeScript (source) | aws-cdk-lib » aws_dynamodb » GlobalSecondaryIndexProps |
Properties for a global secondary index.
Example
const table = new dynamodb.Table(this, 'Table', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
contributorInsightsEnabled: true, // for a table
});
table.addGlobalSecondaryIndex({
contributorInsightsEnabled: true, // for a specific global secondary index
indexName: 'gsi',
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. |
contributor | boolean | Whether CloudWatch contributor insights is enabled for the specified global secondary index. |
max | number | The maximum read request units for the global secondary index. |
max | number | The maximum write request units for the global secondary index. |
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 | number | The read capacity for the global secondary index. |
sort | Attribute | Sort key attribute definition. |
write | number | The write capacity for the global secondary index. |
indexName
Type:
string
The name of the secondary index.
partitionKey
Type:
Attribute
Partition key attribute definition.
contributorInsightsEnabled?
Type:
boolean
(optional, default: false)
Whether CloudWatch contributor insights is enabled for the specified global secondary index.
maxReadRequestUnits?
Type:
number
(optional, 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.
maxWriteRequestUnits?
Type:
number
(optional, 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.
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:
number
(optional, default: 5)
The read capacity for the global secondary index.
Can only be provided if table billingMode is Provisioned or undefined.
sortKey?
Type:
Attribute
(optional, default: no sort key)
Sort key attribute definition.
writeCapacity?
Type:
number
(optional, default: 5)
The write capacity for the global secondary index.
Can only be provided if table billingMode is Provisioned or undefined.