heyo, i am looking at creating dynamo tables via `...
# sst
l
heyo, i am looking at creating dynamo tables via
sst.Table()
. am i correct in understanding there’s no way to create LSIs from SST? everything in
secondaryIndexes
gets created as a GSI (even when re-using the table’s PK). i’m kinda surprised no one’s apparently asked about this on github issues, discussions or even this slack. that makes me think i’m missing something obvious, but i’ve read the docs/source extensively and don’t think so..
t
l
those create global secondary indexes. i want to create a local secondary index
t
oops sorry misread it, one second
So the Table construct exposes the underlying table on which I believe you can call `addSecondaryIndex
let me get the exact details
yep try this
Copy code
const table = new sst.Table()
table.dynamodbTable.addLocalSecondaryIndex(props)
As documented here: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-dynamodb.Table.html#addwbrlocalwbrsecondarywbrindexprops
You're right though we should expose a way to do this directly - will make an issue for it
l
oh damn. i did try something like that, but didn’t think to look closely at what methods were provided on
table.dynamodbTable
t
CDK is a deep complex beast, easy to miss things
l
sweet, yeah, i think adding a way to do it directly thru the options of
new sst.Table()
would be 💯
thank you!
f