Skip to content

Demonstrates how to recover a dynamodb table with pitr and terraform

Notifications You must be signed in to change notification settings

mattslane/dynamodb-pitr-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamodb PITR Example

Setup Backend

Log into Scully and get command line tokens

cd backend
terraform init
terraform apply
cd ..

Create table

cd terraform
terraform init --backend-config backend.hcl

Apply:

terraform apply
cd .. 

Populate table (optional)

This will populate the table with 50,000 randomly generated records. If the table name is not the default 'testing-pitr' the code will need editing.

cd populate
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
python populate.py
deactivate
cd ..

Perform restore

./restore.sh

This doesn't reapply the terraform but does update the code. For a real project the updates should be commited and the CI/CD tooling ran to update everything. Any projects that use the dynamodb table should also be updated to use the new name. The old table should also be manually deleted

Clean up

cd terraform

About

Demonstrates how to recover a dynamodb table with pitr and terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published