Dynamo component lets you add an Amazon DynamoDB table to your app.
Constructor
sst.config.ts
Parameters
fields
Define the fields used for indexes. You only need to define fields used in indexes, not all table fields.
primaryIndex
Define the table’s primary index.
globalIndexes
Configure global secondary indexes. You can have up to 20 global indexes per table.Create composite keys with multiple attributes:
localIndexes
Configure local secondary indexes. You can have up to 5 local indexes per table.
stream
Enable DynamoDB Streams to capture item changes.
Streams are not enabled by default due to associated costs.
ttl
The field name to store Time to Live (TTL) timestamps. Items are deleted when TTL is reached.
Properties
name
arn
nodes
Methods
subscribe
SDK
Query the table from your function code:src/api.ts
Examples
Add a global index
sst.config.ts
Subscribe to streams
sst.config.ts
Link to a function
sst.config.ts