Prevent destroy of RDS database
@@ -28,11 +28,8 @@ resource "aws_db_instance" "database" {
publicly_accessible = false
apply_immediately = true
backup_retention_period = local.is_prod ? 7 : 0
+ deletion_protection = local.is_prod
db_subnet_group_name = data.aws_db_subnet_group.rds.name
vpc_security_group_ids = [data.aws_security_group.rds.id]
-
- lifecycle {
- prevent_destroy = true
- }
}
