Commit a90f423f authored by Bill Wang's avatar Bill Wang Committed by Anton Babenko

Add deletion protection argument (#83)

* Add-deletion_protection-argument

* Add-deletion_protection-argument
parent 4c390c90
......@@ -64,6 +64,9 @@ module "db" {
# Snapshot name upon DB deletion
final_snapshot_identifier = "demodb"
# Database Deletion Protection
deletion_protection = true
parameters = [
{
name = "character_set_client"
......
......@@ -60,4 +60,7 @@ module "db" {
license_model = "license-included"
timezone = "Central Standard Time"
# Database Deletion Protection
deletion_protection = true
}
......@@ -68,6 +68,9 @@ module "db" {
# Snapshot name upon DB deletion
final_snapshot_identifier = "demodb"
# Database Deletion Protection
deletion_protection = true
options = [
{
option_name = "MARIADB_AUDIT_PLUGIN"
......
......@@ -66,4 +66,7 @@ module "db" {
# See here for support character sets https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleCharacterSets.html
character_set_name = "AL32UTF8"
# Database Deletion Protection
deletion_protection = true
}
......@@ -67,4 +67,7 @@ module "db" {
# Snapshot name upon DB deletion
final_snapshot_identifier = "demodb"
# Database Deletion Protection
deletion_protection = true
}
......@@ -82,4 +82,6 @@ module "db" {
major_engine_version = "5.7"
monitoring_interval = "30"
monitoring_role_arn = "${aws_iam_role.rds_enhanced_monitoring.arn}"
# Database Deletion Protection
deletion_protection = true
}
......@@ -104,5 +104,7 @@ module "db_instance" {
timeouts = "${var.timeouts}"
deletion_protection = "${var.deletion_protection}"
tags = "${var.tags}"
}
......@@ -69,6 +69,8 @@ resource "aws_db_instance" "this" {
timeouts = "${var.timeouts}"
deletion_protection = "${var.deletion_protection}"
tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}"
}
......@@ -125,5 +127,7 @@ resource "aws_db_instance" "this_mssql" {
timeouts = "${var.timeouts}"
deletion_protection = "${var.deletion_protection}"
tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}"
}
......@@ -208,3 +208,8 @@ variable "timeouts" {
delete = "40m"
}
}
variable "deletion_protection" {
description = "The database can't be deleted when this value is set to true."
default = false
}
......@@ -258,3 +258,8 @@ variable "timeouts" {
delete = "40m"
}
}
variable "deletion_protection" {
description = "The database can't be deleted when this value is set to true."
default = false
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment