Skip to content

Instantly share code, notes, and snippets.

@manicminer
Last active November 1, 2018 22:44
Show Gist options
  • Save manicminer/79afa49d44339e72b9e2ce78e7e629c4 to your computer and use it in GitHub Desktop.
Save manicminer/79afa49d44339e72b9e2ce78e7e629c4 to your computer and use it in GitHub Desktop.
RDS Production termination protection

RDS Production Termination Protection

Create a policy like this, substituting your AWS account number, then attach it to all groups and roles. It will prevent deletion of RDS instances containing the string "prod" in their name.

Note: This is intended to prevent accidental deletion, and is easily sidestepped.

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"rds:DeleteDBInstance"
],
"Effect": "Deny",
"Resource": "arn:aws:rds:*:123456789012:*prod*"
}
]
}
@giorgiosironi
Copy link

Will try it out, thanks

@chriscannon
Copy link

This worked perfectly! Thank you!

Also just to note for others because I was a little confused about how to attach this policy. I went to IAM > Groups and attached to the relevant group (in this case our SuperUsers group).

@chris530
Copy link

Fantastic !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment