I currently have a dynamodb table that's been in use for a couple of years, originally created in the console. It contains lots of valuable data. It uses a stream to periodically send a snapshot using a lambda trigger of the table to s3 for analytics. The table itself is heavily used by end users to access their data.
I want to migrate my solution into CDK. The options I want to explore:
- When you use the Table.fromTableArn construct, you don't get access to the table stream arn so it's impossible to attach a lambda trigger. Is there a way around this?
- Is there a way to clone the dynamoDB table contents in my CDK stack so that my copy will start off in exactly the same state as the original? Then I can add and manage the stream etc in CDK no problem.
- It's worth checking my assumption that these are the only 2 options.
dynamodb.Table.fromTableAttributes
and pass intableStreamArn
. Then the construct will know that streaming is enabled.Table.fromTableName
does not give you access to the stream, you have to useTable.fromTableAttributes
and specifytableStreamArn
. Here's a comment in the corresponding Github issue that might be helpful: github.com/aws/aws-cdk/issues/14046#issuecomment-818556904