Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Commit 41e186a

Browse files
authored
Make prevent_destroy configurable (#769)
1 parent 67f1d01 commit 41e186a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

terraform/database.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ resource "google_sql_database_instance" "db-inst" {
6060

6161
lifecycle {
6262
# This prevents accidental deletion of the database.
63-
prevent_destroy = true
63+
prevent_destroy = var.prevent_destroy
6464
}
6565

6666
depends_on = [

terraform/variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ variable "enx_redirect_domain_map" {
175175
description = "Redirect domains and environments."
176176
}
177177

178+
variable "prevent_destroy" {
179+
type = bool
180+
default = true
181+
182+
description = "Prevent destruction of critical resources. Set this to false to actually destroy everything."
183+
}
184+
178185
terraform {
179186
required_version = ">= 0.13.1"
180187

0 commit comments

Comments
 (0)