Skip to content

Commit 215059e

Browse files
apeabodyglasnt
andauthored
fix(cloud_sql): remove deletion_protection from default (#848)
Co-authored-by: Katie McLaughlin <[email protected]>
1 parent d5cfcf0 commit 215059e

File tree

41 files changed

+3
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3
-103
lines changed

build/int.cloudbuild.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ steps:
7575
# Add `deletion_protection = false` to google_container_cluster.default resources
7676
find ./gke -name "*.tf" -print | xargs -t -I {} $$GOPATH/bin/hcledit attribute append resource.google_container_cluster.default.deletion_protection 'false' -u -f {} || true
7777
78+
# Add `deletion_protection = false` to google_sql_database_instance.default resources
79+
find ./cloud_sql -name "*.tf" -print | xargs -t -I {} $$GOPATH/bin/hcledit attribute append resource.google_sql_database_instance.default.deletion_protection 'false' -u -f {} || true
80+
7881
- id: prepare
7982
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
8083
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']

cloud_sql/instance_cmek/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,5 @@ resource "google_sql_database_instance" "default" {
9393
settings {
9494
tier = "db-custom-2-7680"
9595
}
96-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
97-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
98-
deletion_protection = false
9996
}
10097
# [END cloud_sql_sqlserver_instance_cmek]

cloud_sql/instance_ha/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,5 @@ resource "google_sql_database_instance" "default" {
6868
start_time = "20:55"
6969
}
7070
}
71-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
72-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
73-
deletion_protection = false
7471
}
7572
# [END cloud_sql_sqlserver_instance_ha]

cloud_sql/instance_iam_condition/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,4 @@ resource "google_sql_database_instance" "default" {
5353
settings {
5454
tier = "db-n1-standard-2"
5555
}
56-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
57-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
58-
deletion_protection = false
5956
}

cloud_sql/instance_labels/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,5 @@ resource "google_sql_database_instance" "default" {
6363
billing-code = 34802
6464
}
6565
}
66-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
67-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
68-
deletion_protection = false
6966
}
7067
# [END cloud_sql_sqlserver_instance_labels]

cloud_sql/instance_pitr/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ resource "google_sql_database_instance" "default" {
2828
transaction_log_retention_days = "3"
2929
}
3030
}
31-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
32-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
33-
deletion_protection = false
3431
}
3532
# [END cloud_sql_mysql_instance_pitr]
3633

cloud_sql/mysql_enterprise_plus_instance_pvp/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,5 @@ resource "google_sql_database_instance" "default" {
3131
enable_password_policy = true
3232
}
3333
}
34-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
35-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
36-
deletion_protection = false
3734
}
3835
# [END cloud_sql_mysql_enterprise_plus_instance_pvp]

cloud_sql/mysql_instance_backup_location/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ resource "google_sql_database_instance" "default" {
2626
location = "asia-northeast1"
2727
}
2828
}
29-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
30-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
31-
deletion_protection = false
3229
}
3330
# [END cloud_sql_mysql_instance_backup_location]

cloud_sql/mysql_instance_backup_retention/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,5 @@ resource "google_sql_database_instance" "default" {
2929
}
3030
}
3131
}
32-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
33-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
34-
deletion_protection = false
3532
}
3633
# [END cloud_sql_mysql_instance_backup_retention]

cloud_sql/mysql_instance_customer_managed_cas_ca/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,5 @@ resource "google_sql_database_instance" "default" {
102102
server_ca_pool = google_privateca_ca_pool.default.id
103103
}
104104
}
105-
deletion_protection = false # set to "true" in production
106105
}
107106
# [END cloud_sql_mysql_instance_customer_managed_cas_ca]

0 commit comments

Comments
 (0)