Skip to content
v2.273.0

SchemaOptions Struct ​

Represents the table schema attributes.

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 schemaOptions: dynamodb.SchemaOptions = {
  partitionKey: {
    name: 'name',
    type: dynamodb.AttributeType.BINARY,
  },
  sortKey: {
    name: 'name',
    type: dynamodb.AttributeType.BINARY,
  },
};

Properties ​

partitionKeyAttributepartition_keyAttributepartitionKeyAttributePartitionKeyAttributePartitionKeyAttribute= exactly one of `partitionKey` an…#
Partition key attribute definition.

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.

sortKeyAttributesort_keyAttributesortKeyAttributeSortKeyAttributeSortKeyAttribute= no sort key#
Sort key attribute definition.

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).