I don't see a way to do this with the SST Table co...
# sst
s
I don't see a way to do this with the SST Table construct. This makes me wonder if it's something the SST construct should provide, or if it's not the "sweet spot" for the Table SST abstraction. In other words, is it fair to say that SST aiming to make the common case easier and not cover all use-cases supported by CDK?
f
Hi @Seth Geoghegan, we will let you pass in a
cdk.Table
construct to the
sst.Table
construct in the coming releases.
This probably doesn’t make sense right now, but when we add DynamoDB streams support to
sst.Table
, you will be able to do something like:
Copy code
new sst.Table(this, "Table", {
  fields: { ... },
  primaryIndex: { ... },
  subscribers: { ... },
});
Where you can simply define the function code to be trigger when ie. a new item is written to the table
And if you need to Table options that are not yet supported by
sst.Table
, you can simply create your table and pass in like:
Copy code
new sst.Table(this, "Table", {
  table: new cdk.Table(...),
  subscribers: { ... },
});
s
I see, sounds like there are big plans! Nice to see there will be an "escape hatch" option to support features that aren't yet natively supported in SST
j
Yup we want to make sure with these constructs that there is a way out — https://docs.serverless-stack.com/design-principles#having-an-escape-hatch
s
Ahh, there it is. Makes sense as you continue to bring functionality online.