AwsDynamodbGlobalSecondaryIndexArgs
interface AwsDynamodbGlobalSecondaryIndexArgs {
copyTableCapacity?: boolean;
name: string;
partitionKey: string;
partitionKeyType: AwsDynamodbAttributeType;
projection?: AwsDynamodbGlobalSecondaryIndexProjectionArgs;
readCapacity?: number;
sortKey?: string;
sortKeyType?: AwsDynamodbAttributeType;
warmThroughput?: AwsDynamodbWarmThroughputArgs;
writeCapacity?: number;
}Global secondary index configuration.
Example
CODE
const index: AwsDynamodbGlobalSecondaryIndexArgs = {
name: 'by-status',
partitionKey: 'status',
partitionKeyType: 'STRING',
projection: {
type: 'INCLUDE',
nonKeyAttributes: ['createdAt'],
},
};Properties
copyTableCapacity: boolean
Whether provisioned table capacity should be copied for this index.
Remarks
Defaults to true when table scenario is provisioned.
name: string
Required index name.
partitionKey: string
Required partition key attribute name.
partitionKeyType: AwsDynamodbAttributeType
Required partition key attribute type.
projection: AwsDynamodbGlobalSecondaryIndexProjectionArgs
Index projection configuration. Defaults to ALL when omitted.
readCapacity: number
Required when scenario is provisioned and copyTableCapacity is false.
sortKey: string
Optional sort key attribute name. Required when sortKeyType is provided.
sortKeyType: AwsDynamodbAttributeType
Required when sortKey is provided, and must not be set when sortKey is omitted.
warmThroughput: AwsDynamodbWarmThroughputArgs
Optional warm throughput settings for this index. When set, at least one of readUnitsPerSecond or writeUnitsPerSecond is required.
writeCapacity: number
Required when scenario is provisioned and copyTableCapacity is false.