DynamoDB Operations

Available operations

Create DynamoDB Table

odin operate component  --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation create-tables --env [YOUR_ENV_NAME] --options='{}'

Properties

Property
Type
Required
Description

commonProperties

No

Common properties that apply to tables. You can override these on individual tables if needed by specifying them at table level.

tables

No

A list of tables to be created.

commonProperties

Common properties that apply to tables. You can override these on individual tables if needed by specifying them at table level.

Property
Type
Required
Description

class

string

No

The table class of the new table. Possible values are: STANDARD, STANDARD_INFREQUENT_ACCESS.

contributorInsightsEnabled

boolean

No

Specifies whether contributor insights is enabled for the table. Default is false

deletionProtectionEnabled

boolean

No

Specifies whether deletion protection is enabled for the table. Default is true

pointInTimeRecovery

No

Enable and customise point in time recovery

sseSpecification

No

Server-side encryption settings for the table.

streamSpecification

No

Settings for DynamoDB Streams on tables.

pointInTimeRecovery

Enable and customize point in time recovery

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether point in time recovery is enabled.

recoveryPeriodInDays

number

No

Indicates whether point in time recovery is enabled.

sseSpecification

Server-side encryption settings for the table.

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether server-side encryption is enabled.

kmsMasterKeyId

string

No

The KMS key identifier for encryption.

sseType

string

No

Possible values are: AES256, KMS.

streamSpecification

Settings for DynamoDB Streams on tables.

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether DynamoDB Streams is enabled.

streamViewType

string

No

Possible values are: NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, KEYS_ONLY.

tables

Properties

Property
Type
Required
Description

attributeDefinitions

object[]

Yes

An array of attributes that describe the key schema for the table.

class

string

Yes

The table class of the new table. Possible values are: STANDARD, STANDARD_INFREQUENT_ACCESS.

keySchema

object[]

Yes

Specifies the attributes that make up the primary key for a table.

name

string

Yes

Alphanumeric characters of length 3 to 255.

  • DynamoDb table name will be created in below format: <environment>-<service>-<component>-<tableName>

    e.g. service name is user-auth, component name is user-dynamodb, table name is user and environment is prod then table will be created as prod-user-auth-user-dynamodb-user in AWS

  • For referencing this index in code use this name

    prod-user-auth-user-dynamodb-user

  • This is to make sure table names do not clash.

contributorInsightsEnabled

boolean

No

Specifies whether contributor insights is enabled for the table. Default is false

deletionProtectionEnabled

boolean

No

Specifies whether deletion protection is enabled for the table. Default is true

indexes

object[]

No

LSI/GSI indexes to be created on the table.

pointInTimeRecovery

object

No

Enable and customise point in time recovery

sseSpecification

object

No

Server-side encryption settings for the table.

streamSpecification

object

No

Settings for DynamoDB Streams on tables.

tags

object[]

No

A list of key-value pairs to label the table.

attributeDefinitions

Properties

Property
Type
Required
Description

name

string

Yes

The name of the attribute.

type

string

Yes

Possible values are: STRING, NUMBER, BINARY.

indexes

Properties

Property
Type
Required
Description

indexName

string

Yes

Name of the index to be created

indexType

string

Yes

Possible values are: GSI, LSI.

keySchema

object[]

Yes

Specifies the attributes that make up the primary key for an index

projection

object

Yes

Attributes that are copied (projected) from the table into the index.

keySchema

Properties

Property
Type
Required
Description

attributeName

string

Yes

The name of the attribute.

keyType

string

Yes

Possible values are: PARTITION_KEY, SORT_KEY.

projection

Attributes that are copied (projected) from the table into the index.

Properties

Property
Type
Required
Description

projectionType

string

Yes

Possible values are: ALL, KEYS_ONLY, INCLUDE.

nonKeyAttributes

string[]

No

Represents the non-key attribute names which will be projected into the index.

keySchema

Properties

Property
Type
Required
Description

attributeName

string

Yes

The name of the attribute.

keyType

string

Yes

Possible values are: PARTITION_KEY, SORT_KEY.

pointInTimeRecovery

Enable and customise point in time recovery

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether point in time recovery is enabled.

recoveryPeriodInDays

number

No

Indicates whether point in time recovery is enabled.

sseSpecification

Server-side encryption settings for the table.

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether server-side encryption is enabled.

kmsMasterKeyId

string

No

The KMS key identifier for encryption.

sseType

string

No

Possible values are: AES256, KMS.

streamSpecification

Settings for DynamoDB Streams on tables.

Properties

Property
Type
Required
Description

enabled

boolean

No

Indicates whether DynamoDB Streams is enabled.

streamViewType

string

No

Possible values are: NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, KEYS_ONLY.

tags

Properties

Property
Type
Required
Description

key

string

Yes

The key of the tag.

value

string

Yes

The value of the tag.

Create DynamoDB Index

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation create-indexes --env [YOUR_ENV_NAME] --options='{}'

Schema for Creating Indexes

This document describes the schema for creating indexes in DynamoDB.

Properties

Property
Type
Required
Description

commonProperties

object

No

Common properties that apply to all indexes. You can override these on individual indexes if needed by specifying them at index level.

indexes

array

Yes

A list of indexes to be created.


commonProperties

Common properties that apply to all indexes. You can override these on individual indexes if needed by specifying them at index level.

Properties

Property
Type
Required
Description

provisionings

object

No

Provisioning properties that apply to indexes.


provisionings

Provisioning properties that apply to indexes.

Properties

Property
Type
Required
Description

provisionedThroughput

object

No

Provisioned throughput settings, applicable only when capacityMode is PROVISIONED.

onDemandThroughput

object

No

Settings for on-demand throughput, applicable only when capacityMode is ON_DEMAND.

warmThroughput

object

No

Instantaneous throughput support.


provisionedThroughput

Provisioned throughput settings, applicable only when capacityMode is PROVISIONED.

Properties

Property
Type
Required
Description

readCapacityUnits

integer

No

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.

writeCapacityUnits

integer

No

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.


onDemandThroughput

Settings for on-demand throughput, applicable only when capacityMode is ON_DEMAND.

Properties

Property
Type
Required
Description

maxReadRequestUnits

integer

No

The maximum number of read request units that the index will support.

maxWriteRequestUnits

integer

No

The maximum number of write request units that the index will support.


warmThroughput

Instantaneous throughput support.

Properties

Property
Type
Required
Description

readUnitsPerSecond

integer

No

The maximum number of reads consumed per second before DynamoDB returns a ThrottlingException.

writeUnitsPerSecond

integer

No

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.


indexes

A list of indexes to be created.

Properties

Property
Type
Required
Description

definition

object

Yes

Definition properties that apply to indexes.

provisioning

object

Yes

Provisioning properties that apply to an index.


definition

Definition properties that apply to indexes.

Properties

Property
Type
Required
Description

tableName

string

Yes

table name used during deploy or create-table operation

indexName

string

Yes

The name of the index.

indexType

string

Yes

Possible values are: GSI.

projection

object

Yes

Attributes that are copied (projected) from the table into the index.

keySchema

array

Yes

Specifies the attributes that make up the primary key for an index.

tags

array

No

A list of key-value pairs to label the index.

attributeDefinitions

array

No

An array of attributes that describe the key schema for the table.


projection

Attributes that are copied (projected) from the table into the index.

Properties

Property
Type
Required
Description

projectionType

string

Yes

Possible values are: ALL, KEYS_ONLY, INCLUDE.

nonKeyAttributes

string[]

No

Represents the non-key attribute names which will be projected into the index.


keySchema

Specifies the attributes that make up the primary key for an index.

Properties

Property
Type
Required
Description

attributeName

string

Yes

The name of the attribute.

keyType

string

Yes

Possible values are: PARTITION_KEY, SORT_KEY.


tags

A list of key-value pairs to label the index.

Properties

Property
Type
Required
Description

key

string

Yes

The key of the tag.

value

string

Yes

The value of the tag.


attributeDefinitions

An array of attributes that describe the key schema for the table.

Properties

Property
Type
Required
Description

name

string

Yes

The name of the attribute.

type

string

Yes

Possible values are: STRING, NUMBER, BINARY.


provisioning

Provisioning properties that apply to an index.

Properties

Property
Type
Required
Description

indexName

string

Yes

The name of the index. Should be same as name indexName in definition

provisionedThroughput

object

No

Applicable only when indexType is GSI.

onDemandThroughput

object

No

Applicable only when indexType is GSI.

warmThroughput

object

No

Number of read and write operations your index will instantaneously support.

tags

array

No

A list of key-value pairs to label the index.


Update DynamoDB Table

odin operate component --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation update-tables --env [YOUR_ENV_NAME] --options='{}'

Schema for Update Table Operation (Array Version)

This document describes the schema for updating DynamoDB tables.

Properties

Property
Type
Required
Description

config

array

Yes

An array of objects, each containing the configuration for updating a table.


config

An array of objects, each containing the configuration for updating a table.

Items

Property
Type
Required
Description

tableName

string

Yes

The name of the table to be updated.

capacityMode

string

No

Provisioned mode is for predictable workloads and on-demand mode is for unpredictable workloads.

provisionedThroughput

object

No

The new provisioned throughput settings for the specified table.

tags

object

No

A list of key-value pairs to label the table.


tableName

The name of the table to be updated.

  • Type: string

  • Pattern: ^[a-zA-Z0-9_.-]{3,255}$


capacityMode

Provisioned mode is for predictable workloads, and on-demand mode is for unpredictable workloads.

  • Type: string

  • Enum: PROVISIONED, ON_DEMAND


provisionedThroughput

The new provisioned throughput settings for the specified table.

Properties

Property
Type
Required
Description

readCapacityUnits

integer

Yes

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.

writeCapacityUnits

integer

Yes

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.


tags

A list of key-value pairs to label the table.

Properties

Property
Type
Required
Description

key

string

Yes

The key of the tag.

value

string

Yes

The value of the tag.


Required Properties

The following properties are required:

  • config

  • Inside config, the tableName property is required for each object.


This schema ensures that all updates to DynamoDB tables are well-defined and follow the specified structure.

Update DynamoDB Index

odin operate component  --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation update-indexes --env [YOUR_ENV_NAME] --options='{}'

Schema for Index Update Operation

This document describes the schema for updating indexes in DynamoDB.

Properties

Property
Type
Required
Description

config

array

Yes

An array of objects, each containing the configuration for updating an index.


config

An array of objects, each containing the configuration for updating an index.

Items

Property
Type
Required
Description

tableName

string

Yes

The name of the table containing the index to be updated.

indexName

string

Yes

The name of the index to be updated.

provisionedThroughput

object

No

Updates the read and write units for the index in PROVISIONED capacity mode.


tableName

The name of the table containing the index to be updated.

  • Type: string


indexName

The name of the index to be updated.

  • Type: string


provisionedThroughput

Updates the read and write units for the index in PROVISIONED capacity mode.

Properties

Property
Type
Required
Description

readCapacityUnits

integer

Yes

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.

writeCapacityUnits

integer

Yes

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.


Required Properties

The following properties are required:

  • config

  • Inside config, the tableName and indexName properties are required for each object.


This schema ensures that all updates to DynamoDB indexes are well-defined and follow the specified structure.

Delete DynamoDB Table

odin operate component  --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation delete-tables --env [YOUR_ENV_NAME] --options='{}'

Schema for Delete Table Operation

This document describes the schema for deleting DynamoDB tables.

Properties

Property
Type
Required
Description

names

array

Yes

An array of existing table names that were provisioned using this component.


names

An array of existing table names that were provisioned using this component.

Items

  • Type: string

  • Pattern: ^[a-zA-Z0-9]{3,255}$ The name of the table must match this pattern.


Required Properties

The following properties are required:

  • names


This schema ensures that all table deletion operations are well-defined and follow the specified structure.

Delete DynamoDB Index

odin operate component  --name [YOUR_COMPONENT_NAME] --service [YOUR_SERVICE_NAME]
--operation delete-indexes --env [YOUR_ENV_NAME] --options='{}'

Configuration Schema for Deleting Indexes

This document describes the schema for deleting indexes from DynamoDB tables.

Properties

Property
Type
Required
Description

config

array

Yes

An array of objects containing the table name and index names to be deleted.


config

An array of objects containing the table name and index names to be deleted.

Items

Property
Type
Required
Description

tableName

string

Yes

The name of the table from which the index is being deleted.

indexes

array

Yes

An array of index names to be deleted.


tableName

The name of the table from which the index is being deleted.

  • Type: string


indexes

An array of index names to be deleted.

Items

  • Type: string


Required Properties

The following properties are required:

  • config

  • Inside config, both tableName and indexes are required for each object.


This schema ensures that all index deletion operations are well-defined and follow the specified structure.

Last updated