Skip to content

Instantly share code, notes, and snippets.

@bboure
Created April 2, 2021 20:11
Show Gist options
  • Save bboure/cfac96b7aab10532bf115843e9436fcb to your computer and use it in GitHub Desktop.
Save bboure/cfac96b7aab10532bf115843e9436fcb to your computer and use it in GitHub Desktop.
5 Ways to Prevent Accidentally Deleting Your CloudFormation Resources
Resources:
MyTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: mytable
{
"Statement": [
{
"Effect": "Allow",
"Action": ["Update:*"],
"Principal": "*",
"Resource": "*"
},
{
"Effect": "Deny",
"Action": ["Update:Delete", "Update:Replace"],
"Principal": "*",
"Resource": ["LogicalResourceId/MyDynamoDBTable"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment