GlobalSecondaryIndexProps Struct
Properties for a global secondary index.
Example
const table = new dynamodb.Table(this, 'Table', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
contributorInsightsSpecification: { // for a table
enabled: true,
mode: dynamodb.ContributorInsightsMode.THROTTLED_KEYS, // only emit throttling events
},
});
table.addGlobalSecondaryIndex({
contributorInsightsSpecification: { // for a specific global secondary index
enabled: true,
},
indexName: 'gsi',
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
});
Properties
contributorInsightsEnabledoptionalbooleancontributor_insights_enabledoptionalboolcontributorInsightsEnabledoptionalBooleanContributorInsightsEnabledoptionalboolContributorInsightsEnabledoptional*bool= falsedeprecated#contributorInsightsSpecificationoptionalContributorInsightsSpecificationcontributor_insights_specificationoptionalContributorInsightsSpecificationcontributorInsightsSpecificationoptionalContributorInsightsSpecificationContributorInsightsSpecificationoptionalContributorInsightsSpecificationContributorInsightsSpecificationoptionalContributorInsightsSpecification#Default: contributor insights is not enabled
maxReadRequestUnitsoptionalnumbermax_read_request_unitsoptionalint | floatmaxReadRequestUnitsoptionalNumberMaxReadRequestUnitsoptionaldoubleMaxReadRequestUnitsoptional*float64#Default: on-demand throughput is disabled
Can only be provided if table billingMode is PAY_PER_REQUEST.
maxWriteRequestUnitsoptionalnumbermax_write_request_unitsoptionalint | floatmaxWriteRequestUnitsoptionalNumberMaxWriteRequestUnitsoptionaldoubleMaxWriteRequestUnitsoptional*float64#Default: on-demand throughput is disabled
Can only be provided if table billingMode is PAY_PER_REQUEST.
nonKeyAttributesoptionalstring[]non_key_attributesoptionaltyping.List[str]nonKeyAttributesoptionalList<String>NonKeyAttributesoptionalstring[]NonKeyAttributesoptional*[]*string#Default: No additional attributes
partitionKeyoptionalAttributepartition_keyoptionalAttributepartitionKeyoptionalAttributePartitionKeyoptionalAttributePartitionKeyoptionalAttribute#Default: exactly one of partitionKey and partitionKeys must be specified.
If a single field forms the partition key, you can use this field. Use the partitionKeys field if the partition key is a multi-attribute key (consists of multiple fields).
partitionKeysoptionalAttribute[]partition_keysoptionaltyping.List[Attribute]partitionKeysoptionalList<Attribute>PartitionKeysoptionalAttribute[]PartitionKeysoptional*[]Attribute#Default: exactly one of partitionKey and partitionKeys must be specified.
notes
If a single field forms the partition key, you can use either partitionKey or partitionKeys to specify the partition key. Exactly one of these must be specified.
You must use partitionKeys field 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.
projectionTypeoptionalProjectionTypeprojection_typeoptionalProjectionTypeprojectionTypeoptionalProjectionTypeProjectionTypeoptionalProjectionTypeProjectionTypeoptionalProjectionType= ALL#readCapacityoptionalnumberread_capacityoptionalint | floatreadCapacityoptionalNumberReadCapacityoptionaldoubleReadCapacityoptional*float64= 5#Can only be provided if table billingMode is Provisioned or undefined.
sortKeyoptionalAttributesort_keyoptionalAttributesortKeyoptionalAttributeSortKeyoptionalAttributeSortKeyoptionalAttribute#Default: no sort key
If a single field forms the sort key, you can use this field. Use the sortKeys field if the sort key is a multi-attribute key (consists of multiple fields).
sortKeysoptionalAttribute[]sort_keysoptionaltyping.List[Attribute]sortKeysoptionalList<Attribute>SortKeysoptionalAttribute[]SortKeysoptional*[]Attribute#Default: no sort key
notes
If a single field forms the sort key, you can use either sortKey or sortKeys to specify the sort key. At most one of these may be specified.
You must use sortKeys field 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!
warmThroughputoptionalWarmThroughputwarm_throughputoptionalWarmThroughputwarmThroughputoptionalWarmThroughputWarmThroughputoptionalWarmThroughputWarmThroughputoptionalWarmThroughput#Default: no warm throughput is configured
writeCapacityoptionalnumberwrite_capacityoptionalint | floatwriteCapacityoptionalNumberWriteCapacityoptionaldoubleWriteCapacityoptional*float64= 5#Can only be provided if table billingMode is Provisioned or undefined.