Created
November 11, 2024 20:38
Setup DynamoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Bucket, StackContext, Table } from "sst/constructs"; | |
export function Dynamo({ stack }: StackContext) { | |
const table = new Table(stack, "dynamo", { | |
fields: { | |
PK: "string", | |
SK: "string", | |
}, | |
primaryIndex: { | |
partitionKey: "PK", | |
sortKey: "SK", | |
}, | |
timeToLiveAttribute: "TTL", | |
}); | |
return { | |
table, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment