DynamoDB - restoring table using PITR for DynamoDB table managed by CloudFormation

1k Views Asked by At

I would like to be able to perform PITR restoration without losing benefit of Infrastructure-as-a-code with CloudFormation.

Specifically, if I perform PITR restoration manually and then point application to the new database, won't that result in new DynamoDB table falling out of CloudFormation managed infrastructure? AFAIK, there is no mechanism at the moment to add a resource to CloudFormation after it was already created. Has anyone solved this problem?

2

There are 2 best solutions below

1
On BEST ANSWER

There is a now a way to import existing resources into cloudformation.

This means that you can do a PiTR and then import the newly created table into your stack.

0
On

You are correct, the restored table will be outside cloudformation control. The only solution that I know of is to write a script that copies that from the recovered table to the original table. Obviously there is a cost and time involved in that and it is less than ideal.

As ever there is always the option to write a custom resource but that somewhat undermines the point of using Cloudformation in the first place.