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

+3
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

-3
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

-3
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

-3
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

-3
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

-3
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

-3
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

-3
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

-3
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

-1
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]

cloud_sql/mysql_instance_google_managed_cas_ca/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ resource "google_sql_database_instance" "default" {
2828
server_ca_mode = "GOOGLE_MANAGED_CAS_CA"
2929
}
3030
}
31-
deletion_protection = false # set to "true" in production
3231
}
3332
# [END cloud_sql_mysql_instance_google_managed_cas_ca]

cloud_sql/mysql_instance_iam_db_auth/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ resource "google_sql_database_instance" "default" {
2828
value = "on"
2929
}
3030
}
31-
# set `deletion_protection` to true, will ensure that one cannot accidentally
32-
# delete this instance by use of Terraform whereas
33-
# `deletion_protection_enabled` flag protects this instance at the GCP level.
34-
deletion_protection = false
3531
}
3632
# [END cloud_sql_mysql_instance_iam_db_auth_create_instance]
3733

cloud_sql/mysql_instance_iam_group_auth/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ resource "google_sql_database_instance" "default" {
2626
value = "on"
2727
}
2828
}
29-
# set `deletion_protection` to true, will ensure that one cannot accidentally
30-
# delete this instance by use of Terraform whereas
31-
# `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3329
}
3430

3531
# Specify the email address of the Cloud Identity group to add to the instance

cloud_sql/mysql_instance_pitr/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,5 @@ 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]

cloud_sql/mysql_instance_psa_psc/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ resource "google_sql_database_instance" "default" {
5555
private_network = google_compute_network.peering_network.id
5656
}
5757
}
58-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
59-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
60-
deletion_protection = false
6158
}
6259
# [END cloud_sql_mysql_instance_psa_psc_instance]
6360

cloud_sql/mysql_instance_psc/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ resource "google_sql_database_instance" "default" {
3434
ipv4_enabled = false
3535
}
3636
}
37-
deletion_protection = false # Set to "true" to prevent destruction of the resource
3837
}
3938
# [END cloud_sql_mysql_instance_psc]
4039

cloud_sql/postgres_enterprise_edition_instance/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ resource "google_sql_database_instance" "default" {
2323
settings {
2424
tier = "db-g1-small"
2525
}
26-
deletion_protection = "false"
2726
}
2827
# [END cloud_sql_enterprise_instance]

cloud_sql/postgres_enterprise_plus_edition_instance/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ resource "google_sql_database_instance" "default" {
2323
tier = "db-perf-optimized-N-96"
2424
edition = "ENTERPRISE_PLUS"
2525
}
26-
deletion_protection = false
2726
}
2827
# [END cloud_sql_enterprise_plus_instance]

cloud_sql/postgres_enterprise_plus_instance_labels/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ resource "google_sql_database_instance" "default" {
2727
billing-code = 34802
2828
}
2929
}
30-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
31-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3330
}
3431
# [END cloud_sql_postgres_enterprise_plus_instance_labels]

cloud_sql/postgres_enterprise_plus_instance_pvp/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,5 @@ resource "google_sql_database_instance" "default" {
3232
enable_password_policy = true
3333
}
3434
}
35-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
36-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
37-
deletion_protection = false
3835
}
3936
# [END cloud_sql_postgres_enterprise_plus_instance_pvp]

cloud_sql/postgres_instance_authorized_network/main.tf

-3
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_postgres_instance_authorized_network]

cloud_sql/postgres_instance_backup_location/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ resource "google_sql_database_instance" "default" {
2626
location = "us-central1"
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_postgres_instance_backup_location]

cloud_sql/postgres_instance_backup_retention/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,5 @@ resource "google_sql_database_instance" "default" {
2929
}
3030
}
3131
}
32-
33-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
34-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
35-
deletion_protection = false
3632
}
3733
# [END cloud_sql_postgres_instance_backup_retention]

cloud_sql/postgres_instance_customer_managed_cas_ca/main.tf

-1
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_postgres_instance_google_managed_cas_ca]

cloud_sql/postgres_instance_google_managed_cas_ca/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ resource "google_sql_database_instance" "default" {
2828
server_ca_mode = "GOOGLE_MANAGED_CAS_CA"
2929
}
3030
}
31-
deletion_protection = false # set to "true" in production
3231
}
3332
# [END cloud_sql_postgres_instance_google_managed_cas_ca]

cloud_sql/postgres_instance_iam_db_auth/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ resource "google_sql_database_instance" "default" {
2828
value = "on"
2929
}
3030
}
31-
# set `deletion_protection` to true, will ensure that one cannot accidentally
32-
# delete this instance by use of Terraform whereas
33-
# `deletion_protection_enabled` flag protects this instance at the GCP level.
34-
deletion_protection = false
3531
}
3632
# [END cloud_sql_postgres_instance_iam_db_auth_create_instance]
3733

cloud_sql/postgres_instance_iam_group_auth/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ resource "google_sql_database_instance" "default" {
2626
value = "on"
2727
}
2828
}
29-
# set `deletion_protection` to true, will ensure that one cannot accidentally
30-
# delete this instance by use of Terraform whereas
31-
# `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3329
}
3430

3531
# Specify the email address of the Cloud Identity group to add to the instance

cloud_sql/postgres_instance_private_ip/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ resource "google_sql_database_instance" "default" {
5656
private_network = google_compute_network.peering_network.id
5757
}
5858
}
59-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
60-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
61-
deletion_protection = false
6259
}
6360
# [END cloud_sql_postgres_instance_private_ip_instance]
6461

cloud_sql/postgres_instance_psa_psc/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ resource "google_sql_database_instance" "default" {
5959
private_network = google_compute_network.peering_network.id
6060
}
6161
}
62-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
63-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
64-
deletion_protection = false # Set to "true" to prevent destruction of the resource
6562
}
6663
# [END cloud_sql_postgres_instance_psa_psc_instance]
6764

cloud_sql/postgres_instance_psc/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ resource "google_sql_database_instance" "default" {
3333
ipv4_enabled = false
3434
}
3535
}
36-
deletion_protection = false # Set to "true" to prevent destruction of the resource
3736
}
3837
# [END cloud_sql_postgres_instance_psc]
3938

cloud_sql/sqlserver_instance_authorized_network/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ resource "google_sql_database_instance" "default" {
3030
}
3131
}
3232
}
33-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
34-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
35-
deletion_protection = false
3633
}
3734
# [END cloud_sql_sqlserver_instance_authorized_network]

cloud_sql/sqlserver_instance_backup/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ resource "google_sql_database_instance" "default" {
2727
start_time = "20:55"
2828
}
2929
}
30-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
31-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3330
}
3431
# [END cloud_sql_sqlserver_instance_backup]

cloud_sql/sqlserver_instance_backup_location/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ resource "google_sql_database_instance" "default" {
2727
location = "us-central1"
2828
}
2929
}
30-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
31-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3330
}
3431
# [END cloud_sql_sqlserver_instance_backup_location]

cloud_sql/sqlserver_instance_backup_retention/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ resource "google_sql_database_instance" "default" {
3030
}
3131
}
3232
}
33-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
34-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
35-
deletion_protection = false
3633
}
3734
# [END cloud_sql_sqlserver_instance_backup_retention]

cloud_sql/sqlserver_instance_cmek/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ resource "google_sql_database_instance" "default" {
6161
settings {
6262
tier = "db-custom-2-7680"
6363
}
64-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
65-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
66-
deletion_protection = false
6764
}
6865
# [END cloud_sql_sqlserver_instance_cmek]

cloud_sql/sqlserver_instance_customer_managed_cas_ca/main.tf

-1
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_sqlserver_instance_require_ssl]

cloud_sql/sqlserver_instance_google_managed_cas_ca/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ resource "google_sql_database_instance" "default" {
2828
server_ca_mode = "GOOGLE_MANAGED_CAS_CA"
2929
}
3030
}
31-
deletion_protection = false # set to "true" in production
3231
}
3332
# [END cloud_sql_sqlserver_instance_require_ssl]

cloud_sql/sqlserver_instance_ha/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,5 @@ resource "google_sql_database_instance" "default" {
2828
start_time = "20:55"
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_sqlserver_instance_ha]

cloud_sql/sqlserver_instance_labels/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ resource "google_sql_database_instance" "default" {
2727
billing-code = 34802
2828
}
2929
}
30-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
31-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
32-
deletion_protection = false
3330
}
3431
# [END cloud_sql_sqlserver_instance_labels]

cloud_sql/sqlserver_instance_psa_psc/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ resource "google_sql_database_instance" "default" {
5656
private_network = google_compute_network.peering_network.id
5757
}
5858
}
59-
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
60-
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
61-
deletion_protection = false
6259
}
6360
# [END cloud_sql_sqlserver_instance_psa_psc_instance]
6461

cloud_sql/sqlserver_instance_psc/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ resource "google_sql_database_instance" "default" {
3535
ipv4_enabled = false
3636
}
3737
}
38-
deletion_protection = false # Set to "true" to prevent destruction of the resource
3938
}
4039
# [END cloud_sql_sqlserver_instance_psc]
4140

0 commit comments

Comments
 (0)