Mr.9715
05/29/2021, 4:36 PMaddGlobalSecondaryIndex()
returns void and the table doesn't have it either.)Frank
How do I set billing mode for GSI in dynamodb (need to set it as PAY_PER_REQUEST)I think GSI inherits the billing model of the table? And by default
sst.Table
has billing mode set to PAY_PER_REQUEST
Is there a way I can check what will be deployed like CDK diffCurrently no. But if you run
sst build
, you can get the generated CF template inside .build/cdk.out
. We will probably add a command ie. sst diff
to simply this.
how do I export the GSI name as CfnOutputThe key for the
secondaryIndexes
field is the index name. You can add it to the stack output like this:
new Table(this, "Notes", {
fields: {
userId: TableFieldType.STRING,
noteId: TableFieldType.STRING,
time: TableFieldType.NUMBER,
},
primaryIndex: { partitionKey: "noteId", sortKey: "userId" },
secondaryIndexes: {
userTimeIndex: { partitionKey: "userId", sortKey: "time" },
},
});
this.addOutputs({
INDEX_NAME: "userTimeIndex",
});
Mr.9715
05/29/2021, 5:05 PMMr.9715
05/29/2021, 5:43 PMFrank
sst diff
, and drew down some notes on how we could implement the command. SST is written in JS, super welcome to take a crack at it👍