interface GlobalSecondaryIndexProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.DynamoDB.GlobalSecondaryIndexProps |
Java | software.amazon.awscdk.services.dynamodb.GlobalSecondaryIndexProps |
Python | aws_cdk.aws_dynamodb.GlobalSecondaryIndexProps |
TypeScript (source) | @aws-cdk/aws-dynamodb » GlobalSecondaryIndexProps |
Properties for a global secondary index.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as dynamodb from '@aws-cdk/aws-dynamodb';
const globalSecondaryIndexProps: dynamodb.GlobalSecondaryIndexProps = {
indexName: 'indexName',
partitionKey: {
name: 'name',
type: dynamodb.AttributeType.BINARY,
},
// the properties below are optional
nonKeyAttributes: ['nonKeyAttributes'],
projectionType: dynamodb.ProjectionType.KEYS_ONLY,
readCapacity: 123,
sortKey: {
name: 'name',
type: dynamodb.AttributeType.BINARY,
},
writeCapacity: 123,
};
Properties
Name | Type | Description |
---|---|---|
index | string | The name of the secondary index. |
partition | Attribute | Partition key attribute definition. |
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.
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.