Skip to main content

AwsDynamoDBServiceModuleSchema

AwsDynamoDBServiceModuleSchema is the input schema for the AwsDynamoDBServiceModule module: one table, its keys and indexes, how it is billed, and how it is protected. Its fields keep DynamoDB's own names, so the AWS documentation for a table explains each one too.

@group

Modules/Service/AwsDynamoDBService

@see

AwsDynamoDBServiceModule to learn more about the module.

Index

Properties

AttributeDefinitions

AttributeDefinitions: { AttributeName: string; AttributeType: B | N | S }[]

The type of every attribute a key or an index names, in KeySchema, LocalSecondaryIndexes or GlobalSecondaryIndexes: each an AttributeName and its AttributeType, S for a string, N for a number or B for binary. Other attributes of an item need no definition.

billingMode

billingMode: { settings: DynamoDBBillingPayPerRequestSchema; type: PAY_PER_REQUEST } | { settings: DynamoDBBillingProvisionedSchema; type: PROVISIONED }

How the table is billed, as a type and its settings. PAY_PER_REQUEST bills each read and write, with an optional OnDemandThroughput cap; PROVISIONED bills the read and write capacity units you reserve, used or not.

optionalDeletionProtectionEnabled

DeletionProtectionEnabled?: boolean = false

Whether AWS refuses to delete the table. An apply that would delete or replace a protected table fails until this is turned off and applied first. A run that changes it changes nothing else about the table.

optionalGlobalSecondaryIndexes

GlobalSecondaryIndexes?: DynamoDBSecondaryIndexSchema[] = []

Indexes with a key of their own, queried apart from the table. One is added per run, and an existing one never changes.

KeySchema

KeySchema: DynamoDBKeySchema[]

The table's primary key: exactly one HASH (partition) key, and an optional RANGE (sort) key.

optionalLocalSecondaryIndexes

LocalSecondaryIndexes?: DynamoDBSecondaryIndexSchema[] = []

Indexes sharing the table's partition key with another sort key. They exist only from the table's creation: adding or changing one replaces the table.

optionalPointInTimeRecoveryEnabled

PointInTimeRecoveryEnabled?: boolean = false

Whether AWS keeps continuous backups of the table, from which it can be restored to any second of the last 35 days.

region

region: Region

The region the table is created in, as produced by any of the AWS region modules.

optionalStreamSpecification

StreamSpecification?: { StreamViewType: KEYS_ONLY | NEW_AND_OLD_IMAGES | NEW_IMAGE | OLD_IMAGE } | null = null

Turns on the table's change stream, recording each change as its StreamViewType says. Replicating the table with AwsDynamoDBGlobalServiceModule needs NEW_AND_OLD_IMAGES.

TableName

TableName: string

The table's name, unique in its region: 3 to 255 letters, digits, _, - and ..

optionaltimeToLiveAttribute

timeToLiveAttribute?: string | null = null

The attribute holding each item's expiry, as a Unix time in seconds. DynamoDB deletes an item some time after it expires, at no cost.