Skip to content

Commit 2c5fb47

Browse files
EvyBongersEvy Bongers
authored and
Evy Bongers
committed
Make instance.deletion_protection configurable
1 parent 1cafd70 commit 2c5fb47

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

instance.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
resource "google_sql_database_instance" "instance" {
22
database_version = var.database_version
33
name = var.instance_name
4+
deletion_protection = var.deletion_protection
45
master_instance_name = var.primary_instance_name
56
settings {
67
availability_type = var.highly_available == true ? "REGIONAL" : "ZONAL"

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ variable "databases" {
1616
type = list(string)
1717
}
1818

19+
variable "deletion_protection" {
20+
type = bool
21+
default = true
22+
}
23+
1924
variable "environment" {
2025
type = string
2126
validation {

0 commit comments

Comments
 (0)