aws-cdk-lib.aws_dynamodb.GlobalSecondaryIndexProps

interface GlobalSecondaryIndexProps

LanguageType name
.NETAmazon.CDK.AWS.DynamoDB.GlobalSecondaryIndexProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#GlobalSecondaryIndexProps
Javasoftware.amazon.awscdk.services.dynamodb.GlobalSecondaryIndexProps
Pythonaws_cdk.aws_dynamodb.GlobalSecondaryIndexProps
TypeScript (source)aws-cdk-lib » 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 { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
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

NameTypeDescription
indexNamestringThe name of the secondary index.
partitionKeyAttributePartition key attribute definition.
nonKeyAttributes?string[]The non-key attributes that are projected into the secondary index.
projectionType?ProjectionTypeThe set of attributes that are projected into the secondary index.
readCapacity?numberThe read capacity for the global secondary index.
sortKey?AttributeSort key attribute definition.
writeCapacity?numberThe 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: ProjectionType (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.