Attilah
Attilah

Reputation: 17930

AWS SAM and DynamoDB table in production

I am using AWS SAM to define my app, and I am defining a DynamoDB table using this: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tablename

However, I am worried that in Prod, this will lead to deleting the table and its content.

How do others handle this? Is there a way to keep the table and not drop and recreate it?

Upvotes: 1

Views: 855

Answers (1)

Daniel Scott
Daniel Scott

Reputation: 7913

  1. Use changesets and check them carefully to ensure that you are not causing a replacement of the table.
  2. Use Deletion and UpdateReplace policies to ensure you do not lose data, even if you do replace it by accident.
  3. Use a stack policy to block updates to the resource

Upvotes: 2

Related Questions