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
contributorInsightsEnabledbooleancontributor_insights_enabledboolcontributorInsightsEnabledBooleanContributorInsightsEnabledboolContributorInsightsEnabled*bool= falsedeprecated#contributorInsightsSpecificationContributorInsightsSpecificationcontributor_insights_specificationContributorInsightsSpecificationcontributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecification= contributor insights is not enab…#default
Default: contributor insights is not enabled
maxReadRequestUnitsnumbermax_read_request_unitsint | floatmaxReadRequestUnitsNumberMaxReadRequestUnitsdoubleMaxReadRequestUnits*float64= on-demand throughput is disabled#Can only be provided if table billingMode is PAY_PER_REQUEST.
maxWriteRequestUnitsnumbermax_write_request_unitsint | floatmaxWriteRequestUnitsNumberMaxWriteRequestUnitsdoubleMaxWriteRequestUnits*float64= on-demand throughput is disabled#Can only be provided if table billingMode is PAY_PER_REQUEST.
nonKeyAttributesstring[]non_key_attributestyping.List[str]nonKeyAttributesList<String>NonKeyAttributesstring[]NonKeyAttributes*[]*string= No additional attributes#partitionKeyAttributepartition_keyAttributepartitionKeyAttributePartitionKeyAttributePartitionKeyAttribute= exactly one of `partitionKey` an…#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).
default
Default: exactly one of partitionKey and partitionKeys must be specified.
partitionKeysAttribute[]partition_keystyping.List[Attribute]partitionKeysList<Attribute>PartitionKeysAttribute[]PartitionKeys*[]Attribute= exactly one of `partitionKey` an…#notes · default
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.
Default: exactly one of partitionKey and partitionKeys must be specified.
projectionTypeProjectionTypeprojection_typeProjectionTypeprojectionTypeProjectionTypeProjectionTypeProjectionTypeProjectionTypeProjectionType= ALL#readCapacitynumberread_capacityint | floatreadCapacityNumberReadCapacitydoubleReadCapacity*float64= 5#Can only be provided if table billingMode is Provisioned or undefined.
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).
sortKeysAttribute[]sort_keystyping.List[Attribute]sortKeysList<Attribute>SortKeysAttribute[]SortKeys*[]Attribute= 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!
warmThroughputWarmThroughputwarm_throughputWarmThroughputwarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughput= no warm throughput is configured#writeCapacitynumberwrite_capacityint | floatwriteCapacityNumberWriteCapacitydoubleWriteCapacity*float64= 5#Can only be provided if table billingMode is Provisioned or undefined.