Skip to content

Commit

Permalink
Add Aurora deletion protection variable (#116)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
chauvm authored Sep 12, 2019
1 parent 384ed74 commit ddf566a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions aws-aurora-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module "aurora" {
database_password = "${var.database_password}"
database_username = "${var.database_username}"
db_parameters = "${var.db_parameters}"
db_deletion_protection = "${var.db_deletion_protection}"
rds_cluster_parameters = "${var.rds_cluster_parameters}"
iam_database_authentication_enabled = "${var.iam_database_authentication_enabled}"
performance_insights_enabled = "${var.performance_insights_enabled}"
Expand Down
5 changes: 5 additions & 0 deletions aws-aurora-mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,8 @@ variable "iam_database_authentication_enabled" {
type = "string"
default = false
}

variable "db_deletion_protection" {
type = "string"
default = false
}
1 change: 1 addition & 0 deletions aws-aurora/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ resource "aws_rds_cluster" "db" {
kms_key_id = "${var.kms_key_id}"
port = "${var.port}"
db_cluster_parameter_group_name = "${aws_rds_cluster_parameter_group.db.id}"
deletion_protection = "${var.db_deletion_protection}"

enabled_cloudwatch_logs_exports = "${var.enabled_cloudwatch_logs_exports}"

Expand Down
5 changes: 5 additions & 0 deletions aws-aurora/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,8 @@ variable "performance_insights_enabled" {
type = "string"
default = true
}

variable "db_deletion_protection" {
type = "string"
default = false
}

0 comments on commit ddf566a

Please sign in to comment.