Skip to content

Commit

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

[upstream:9905a08d80a5fc0bc137ae2cb06bac27e29678ac]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Aug 13, 2024
1 parent f3e6d40 commit 07b441d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ resource "google_project" "example-project" {

name = "My Project"
project_id = "example-project"
deletion_policy = "DELETE"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/hcl/v2 v2.20.1
github.com/hashicorp/terraform-json v0.22.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240812171408-f2629637626e
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240813155749-67547a5f41aa
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A=
github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c=
github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240812171408-f2629637626e h1:NX0WwvzaObWj6s2lGgSJ527O17RcL+sMi46PbhGg6Eo=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240812171408-f2629637626e/go.mod h1:mbLHS7zKRfkaFt9qpT/cmmwnrB5NSdnz1jpDoAZd6A0=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240813155749-67547a5f41aa h1:SeKPL2x8K3HLMJi343a47ELG8sc87dUNvhs5UNzW6Jc=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20240813155749-67547a5f41aa/go.mod h1:mbLHS7zKRfkaFt9qpT/cmmwnrB5NSdnz1jpDoAZd6A0=
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
Expand Down
1 change: 1 addition & 0 deletions tfplan2cai/testdata/templates/example_project_create.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "google_project" "my_project-in-a-folder" {
folder_id = google_folder.department1.name

billing_account = "{{.Project.BillingAccountName}}"
deletion_policy = "DELETE"

labels = {
"project-label-key-a" = "project-label-val-a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "google_project" "my_project-in-a-folder" {
folder_id = google_folder.department1.name

billing_account = "{{.Project.BillingAccountName}}"
deletion_policy = "DELETE"

labels = {
"project-label-key-a" = "project-label-val-a"
Expand Down
1 change: 1 addition & 0 deletions tfplan2cai/testdata/templates/example_project_in_folder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ resource "google_project" "my_project" {
name = "My Project"
project_id = "foobat"
folder_id = "folders/{{.FolderID}}"
deletion_policy = "DELETE"
}
1 change: 1 addition & 0 deletions tfplan2cai/testdata/templates/example_project_in_org.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ resource "google_project" "my_project" {
name = "My Project"
project_id = "foobat"
org_id = "{{.OrgID}}"
deletion_policy = "DELETE"
}
1 change: 1 addition & 0 deletions tfplan2cai/testdata/templates/example_project_update.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ resource "google_project" "my_project" {
labels = {
"project-label-key-a" = "project-label-val-a"
}
deletion_policy = "DELETE"
}

0 comments on commit 07b441d

Please sign in to comment.