Jason S
05/25/2022, 2:34 AMKevin Grimm
05/25/2022, 2:39 AMimport { RemovalPolicy } from "aws-cdk-lib";
new Table(stack, "Table", {
fields: {
userId: "string",
noteId: "string",
},
primaryIndex: { partitionKey: "noteId", sortKey: "userId" },
cdk: {
table: {
removalPolicy: RemovalPolicy.DESTROY,
},
},
});
Jason S
05/25/2022, 2:46 AMfields
object define additional attributes? Or are these reserved only for hash and range keys?Jason S
05/25/2022, 2:46 AMKevin Grimm
05/25/2022, 2:47 AMJason S
05/25/2022, 2:48 AMJason S
05/25/2022, 2:48 AMKevin Grimm
05/25/2022, 2:51 AMJason S
05/25/2022, 2:52 AMJason S
05/25/2022, 4:02 AMJason S
05/25/2022, 4:02 AMJason S
05/25/2022, 4:03 AMcdk.table?
property remove the resource from local if it does not exist on remote?Jason S
05/25/2022, 4:03 AMKevin Grimm
05/25/2022, 4:04 AMKevin Grimm
05/25/2022, 4:05 AMnpx sst start
?Jason S
05/25/2022, 4:07 AMnew sst.Table(...)
. I run npx sst start
and the table has been created. I updated the field names in the fields
prop. SST does not detect stack changes. I deleted the DynamoDB table from the AWS Console. In the SST Console, the original table appears with the old records. I expected the table in the SST Console to have been rebuilt showing me the new field names and having no records.Jason S
05/25/2022, 4:08 AMKevin Grimm
05/25/2022, 4:13 AMnpx sst remove
to remove the stack. It sounds like you want to simply redeploy the stack with an altered table? In that case removing the stack and redeploying is likely the easiest option. I'm not sure if stack changes can be detected and deployed by SST.
https://docs.serverless-stack.com/packages/cli#remove-stackJason S
05/25/2022, 4:17 AMJason S
05/25/2022, 5:03 AMFrank
Frank
new Table
line in ur SST app, and then deploy, the table would’ve been removed.Kevin Grimm
05/25/2022, 11:31 PMJason S
05/26/2022, 1:00 AM