I'm trying to attach a DynamoDB stream handler fun...
# general
s
I'm trying to attach a DynamoDB stream handler function to a
cloud.Table
, but
postsTable.dynamodbTable.onEvent( 'parseFeedPost', async ( e ) => {
won't deploy because the stream doesn't exist and throws an error based on an empty ARN. It doesn't appear that I can set that directly when creating a Cloud Table, is there a way to set it later i.e. const enableStream = () => { postsTable.dynamodbTable.streamEnabled( true ); };?
w
I believe you cannot do this with
cloud.Table
- but since you are relying on AWS explicitly here anyway, you can just use
new aws.dynamodb.Table()
to get full flexibility. Note that you will then need to use
aws.sdk.dynamodb.DocumentClient
to operate on the table, but this will again give you full flexibility with DynamoDB. Here’s a good example of this: https://github.com/pulumi/examples/blob/master/aws-ts-apigateway/index.ts