DEV Community

Discussion on: Using DynamoDB Streams to sync back to your old database

Collapse
 
martzcodes profile image
Matt Martz

The examples above are in typescript. This part of the dynamodb table construct stream: StreamViewType.NEW_IMAGE is what enables streams specifically for new images (which fits your use). I'd need more detail from you to figure out what trouble you're running into.

Collapse
 
sambasivaravuri profile image
sambasivaravuri • Edited

Thank you Matt for quick response. I understand that these examples wrote in Typescript only.

My requirement is, I have 15 existing tables and for all existing 15 tables, i need to enable triggering as well as need to enable streams.

I need your guidance how to code it in Typescript like for all 15 existing different tables.
Please help me, whether i need to code it for one existing table and need to replicate for rest of the existing tables ? Or, we need to code it as generic one and need to pass all these tables as part of Environment variables.
Kindly guide me and also share the Typescript code.
Appreciate for quick response.

Thank you.

Thread Thread
 
sambasivaravuri profile image
sambasivaravuri

One more point forgot to mention that am looking for only new items in DyanmoDB table (new image) and Lambda needs to be triggered.

Thread Thread
 
martzcodes profile image
Matt Martz

If your tables were created by CDK to begin with, you should just be able to add that line to each table and re-deploy. If not, you'd need to import the table by ARN and apply the change. I haven't done that personally but you should be able to piece it together from the docs: docs.aws.amazon.com/cdk/api/latest...