Skip to content

Commit ddf566a

Browse files
authored
Add Aurora deletion protection variable (#116)
* Make db cluster parameter group configurable * Add Aurora's database deletion protection * Remove prev WIP * Add back db parameter * Default deletion protection to false * Deletion back to true by default, fix test * Add default value to aws-aurora module * Test changing var name * Revert name change, make test hung up * Fix tests
1 parent 384ed74 commit ddf566a

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

aws-aurora-mysql/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module "aurora" {
1313
database_password = "${var.database_password}"
1414
database_username = "${var.database_username}"
1515
db_parameters = "${var.db_parameters}"
16+
db_deletion_protection = "${var.db_deletion_protection}"
1617
rds_cluster_parameters = "${var.rds_cluster_parameters}"
1718
iam_database_authentication_enabled = "${var.iam_database_authentication_enabled}"
1819
performance_insights_enabled = "${var.performance_insights_enabled}"

aws-aurora-mysql/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,8 @@ variable "iam_database_authentication_enabled" {
150150
type = "string"
151151
default = false
152152
}
153+
154+
variable "db_deletion_protection" {
155+
type = "string"
156+
default = false
157+
}

aws-aurora/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ resource "aws_rds_cluster" "db" {
5151
kms_key_id = "${var.kms_key_id}"
5252
port = "${var.port}"
5353
db_cluster_parameter_group_name = "${aws_rds_cluster_parameter_group.db.id}"
54+
deletion_protection = "${var.db_deletion_protection}"
5455

5556
enabled_cloudwatch_logs_exports = "${var.enabled_cloudwatch_logs_exports}"
5657

aws-aurora/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,8 @@ variable "performance_insights_enabled" {
112112
type = "string"
113113
default = true
114114
}
115+
116+
variable "db_deletion_protection" {
117+
type = "string"
118+
default = false
119+
}

0 commit comments

Comments
 (0)