Skip to content
v2.274.0

KeySchema Struct ​

A description of a key schema of an LSI, GSI or Table.

Example ​

ts
// 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 keySchema: dynamodb.KeySchema = {
  partitionKeys: [{
    name: 'name',
    type: dynamodb.AttributeType.BINARY,
  }],
  sortKeys: [{
    name: 'name',
    type: dynamodb.AttributeType.BINARY,
  }],
};

Properties ​

partitionKeysAttribute[]partition_keystyping.List[Attribute]partitionKeysList<Attribute>PartitionKeysAttribute[]PartitionKeys*[]Attributerequired#
Partition key definition.

This array has at least one, but potentially multiple entries. Together, they form the partition key.

sortKeysAttribute[]sort_keystyping.List[Attribute]sortKeysList<Attribute>SortKeysAttribute[]SortKeys*[]Attributerequired#
Sort key definition.

This array has zero or more entries. Together, they form the sort key.