File tree Expand file tree Collapse file tree 9 files changed +23
-0
lines changed Expand file tree Collapse file tree 9 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ The following dependency must be available for SQL Server module:
2222| db\_ collation | The collation for the default database. Example: 'en_US.UTF8' | string | ` "" ` | no |
2323| db\_ name | The name of the default database to create | string | ` "default" ` | no |
2424| delete\_ timeout | The optional timout that is applied to limit long database deletes. | string | ` "30m" ` | no |
25+ | deletion\_ protection | Used to block Terraform from deleting a SQL Instance. | bool | ` "true" ` | no |
2526| disk\_ autoresize | Configuration to increase storage size. | bool | ` "true" ` | no |
2627| disk\_ size | The disk size for the master instance. | string | ` "10" ` | no |
2728| disk\_ type | The disk type for the master instance. | string | ` "PD_SSD" ` | no |
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ resource "google_sql_database_instance" "default" {
4545 region = var. region
4646 encryption_key_name = var. encryption_key_name
4747 root_password = coalesce (var. root_password , random_password. root-password . result )
48+ deletion_protection = var. deletion_protection
4849
4950 settings {
5051 tier = var. tier
Original file line number Diff line number Diff line change @@ -246,3 +246,9 @@ variable "encryption_key_name" {
246246 type = string
247247 default = null
248248}
249+
250+ variable "deletion_protection" {
251+ description = " Used to block Terraform from deleting a SQL Instance."
252+ type = bool
253+ default = true
254+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
2020| db\_ collation | The collation for the default database. Example: 'utf8_general_ci' | string | ` "" ` | no |
2121| db\_ name | The name of the default database to create | string | ` "default" ` | no |
2222| delete\_ timeout | The optional timout that is applied to limit long database deletes. | string | ` "10m" ` | no |
23+ | deletion\_ protection | Used to block Terraform from deleting a SQL Instance. | bool | ` "true" ` | no |
2324| disk\_ autoresize | Configuration to increase storage size | bool | ` "true" ` | no |
2425| disk\_ size | The disk size for the master instance | number | ` "10" ` | no |
2526| disk\_ type | The disk type for the master instance. | string | ` "PD_SSD" ` | no |
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ resource "google_sql_database_instance" "default" {
4646 database_version = var. database_version
4747 region = var. region
4848 encryption_key_name = var. encryption_key_name
49+ deletion_protection = var. deletion_protection
4950
5051 settings {
5152 tier = var. tier
Original file line number Diff line number Diff line change @@ -279,3 +279,9 @@ variable "module_depends_on" {
279279 type = list (any )
280280 default = []
281281}
282+
283+ variable "deletion_protection" {
284+ description = " Used to block Terraform from deleting a SQL Instance."
285+ type = bool
286+ default = true
287+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
1919| db\_ collation | The collation for the default database. Example: 'en_US.UTF8' | string | ` "" ` | no |
2020| db\_ name | The name of the default database to create | string | ` "default" ` | no |
2121| delete\_ timeout | The optional timout that is applied to limit long database deletes. | string | ` "10m" ` | no |
22+ | deletion\_ protection | Used to block Terraform from deleting a SQL Instance. | bool | ` "true" ` | no |
2223| disk\_ autoresize | Configuration to increase storage size. | bool | ` "true" ` | no |
2324| disk\_ size | The disk size for the master instance. | string | ` "10" ` | no |
2425| disk\_ type | The disk type for the master instance. | string | ` "PD_SSD" ` | no |
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ resource "google_sql_database_instance" "default" {
4141 database_version = var. database_version
4242 region = var. region
4343 encryption_key_name = var. encryption_key_name
44+ deletion_protection = var. deletion_protection
4445
4546 settings {
4647 tier = var. tier
Original file line number Diff line number Diff line change @@ -262,3 +262,8 @@ variable "module_depends_on" {
262262 default = []
263263}
264264
265+ variable "deletion_protection" {
266+ description = " Used to block Terraform from deleting a SQL Instance."
267+ type = bool
268+ default = true
269+ }
You can’t perform that action at this time.
0 commit comments