Skip to content

Commit

Permalink
Make deletion_policy field for Project resource PREVENT by default (G…
Browse files Browse the repository at this point in the history
…oogleCloudPlatform#11255)

Co-authored-by: Zhenhua Li <[email protected]>
  • Loading branch information
abd-goog and zli82016 authored Aug 13, 2024
1 parent f1026bb commit 9905a08
Show file tree
Hide file tree
Showing 284 changed files with 565 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "google_project" "project" {
project_id = "<%= ctx[:test_env_vars]['project'] %>"
name = "<%= ctx[:test_env_vars]['project'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "google_access_context_manager_access_policy" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ resource "google_project" "peered-project" {
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test-%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test-%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test-%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "apigee" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "my_project" {
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_app_engine_application" "app" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "my_project" {
project_id = "<%= ctx[:vars]['project'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_app_engine_application" "app" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "google_project" "service_project" {
name = "Service Project"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

# Enable Compute API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "google_project" "service_project" {
name = "Service Project"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

# Enable Compute API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resource "google_project" "service_project" {
project_id ="<%= ctx[:vars]['service_project_attachment_id'] %>"
name = "Service Project"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_120s" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resource "google_project" "service_project_full" {
project_id ="<%= ctx[:vars]['service_project_attachment_id'] %>"
name = "Service Project Full"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_120s" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "google_project" "service_project" {
name = "Service Project"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

# Enable Compute API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "google_project" "service_project" {
name = "Service Project"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

# Enable Compute API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "google_project" "project" {
project_id = "tf-test%{random_suffix}"
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
lifecycle {
ignore_changes = [billing_account]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "project" {
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "compute" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "my_project" {
name = "tf-test-project"
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "google_service_usage_consumer_quota_override" "override" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "my_project" {
name = "tf-test-project"
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "google_service_usage_consumer_quota_override" "override" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_project" "my_project" {
name = "tf-test-project"
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "google_service_usage_consumer_quota_override" "override" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "google_project" "agent_project" {
project_id = "<%= ctx[:vars]['project_id'] %>"
name = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
deletion_policy = "DELETE"
}

resource "google_project_service" "agent_project" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ resource "google_project" "project_1" {
project_id = "<%= ctx[:vars]['project_1_name'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_project" "project_2" {
name = "<%= ctx[:vars]['project_2_name'] %>"
project_id = "<%= ctx[:vars]['project_2_name'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
deletion_policy = "DELETE"
}

resource "google_compute_network" "network_1_project_1" {
Expand Down
Loading

0 comments on commit 9905a08

Please sign in to comment.