aws-samples / amazon-dynamodb-labs

Hands on workshop and design scenarios for Amazon DynamoDB
https://catalog.workshops.aws/dynamodb-labs
Apache License 2.0
167 stars 114 forks source link

Prevent stack deletion unless DynamoDB resources are cleaned up #42

Open switch180 opened 3 years ago

switch180 commented 3 years ago

Issue: Tables are left scaled up after stack deletion. We have banners in the lab explaining the importance of deleting DDB tables, but these aren't foolproof.

Recommended resolution:

matheuscanela commented 3 years ago

My customer left the lab running and it charged around 10K

I have a few suggestions to help avoid it.

1) Add the billing alarm to the DDB CFN, also, add a step to enable the billing metric before running the CFN - some docs below https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-cloudwatch.html#cloudwatch-sample-billing-alarm https://github.com/pyraven/cloudformation_sms_alarm

2) or, create the CFN with lower RCU/WCU, and allow the user to decide the number, so there is no excuse that they don't know it is going to cost a fortune.