Skip to content

Commit 1c1e018

Browse files
authored
feat!: deletion_policy PREVENT as default (#940)
1 parent b0ed8a5 commit 1c1e018

File tree

20 files changed

+56
-5
lines changed

20 files changed

+56
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ determining that location is as follows:
137137
| create\_project\_sa | Whether the default service account for the project shall be created | `bool` | `true` | no |
138138
| default\_network\_tier | Default Network Service Tier for resources created in this project. If unset, the value will not be modified. See https://cloud.google.com/network-tiers/docs/using-network-service-tiers and https://cloud.google.com/network-tiers. | `string` | `""` | no |
139139
| default\_service\_account | Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`. | `string` | `"disable"` | no |
140-
| deletion\_policy | The deletion policy for the project. | `string` | `null` | no |
140+
| deletion\_policy | The deletion policy for the project. | `string` | `"PREVENT"` | no |
141141
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. | `bool` | `true` | no |
142142
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | `bool` | `true` | no |
143143
| domain | The domain name (optional). | `string` | `""` | no |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Upgrading to Project Factory v17.0
2+
3+
The v17.0 release of Project Factory is a backwards incompatible release.
4+
5+
### Google Cloud Provider Project deletion_policy
6+
7+
The `deletion_policy` for projects now defaults to `"PREVENT"` rather than `"DELETE"`. This aligns with the behavior in Google Cloud Platform Provider v6+. To maintain the old behavior you can set `deletion_policy = "DELETE"`.
8+
9+
```diff
10+
module "project" {
11+
- version = "~> 16.0"
12+
+ version = "~> 17.0"
13+
14+
+ deletion_policy = "DELETE"
15+
}
16+
```
17+
18+
### Google Cloud Platform Provider upgrade
19+
20+
The Project Factory module now requires version `5.41` or higher of the Google Cloud Platform Provider and `5.41` or higher of the Google Cloud Platform Beta Provider.

examples/app_engine/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module "app-engine-project" {
3232
activate_apis = [
3333
"appengine.googleapis.com",
3434
]
35+
36+
deletion_policy = "DELETE"
3537
}
3638

3739
module "app-engine" {

examples/budget_project/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module "budget_project" {
3838
"billingbudgets.googleapis.com"
3939
]
4040

41+
deletion_policy = "DELETE"
4142
}
4243

4344

examples/essential_contacts/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ module "project-factory" {
4141

4242
default_service_account = "DISABLE"
4343
disable_services_on_destroy = false
44+
45+
deletion_policy = "DELETE"
4446
}

examples/fabric_project/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ module "fabric-project" {
3535
owners = var.owners
3636
parent = var.parent
3737
prefix = local.prefix
38+
39+
deletion_policy = "DELETE"
3840
}

examples/gke_shared_vpc/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ module "project-factory" {
2626
activate_apis = ["compute.googleapis.com", "container.googleapis.com", "cloudbilling.googleapis.com"]
2727
shared_vpc_subnets = var.shared_vpc_subnets
2828
default_network_tier = var.default_network_tier
29+
30+
deletion_policy = "DELETE"
2931
}

examples/quota_project/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ module "quota-project" {
5858
value = "95"
5959
}
6060
]
61+
62+
deletion_policy = "DELETE"
6163
}

examples/shared_vpc/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module "host-project" {
3939
"cloudresourcemanager.googleapis.com"
4040
]
4141

42+
deletion_policy = "DELETE"
4243
}
4344

4445
/******************************************
@@ -113,6 +114,7 @@ module "service-project" {
113114
]
114115

115116
disable_services_on_destroy = false
117+
deletion_policy = "DELETE"
116118
}
117119

118120
/******************************************
@@ -146,6 +148,7 @@ module "service-project-b" {
146148
}]
147149

148150
disable_services_on_destroy = false
151+
deletion_policy = "DELETE"
149152
}
150153

151154
/******************************************
@@ -184,6 +187,7 @@ module "service-project-c" {
184187

185188
disable_services_on_destroy = false
186189
grant_network_role = false
190+
deletion_policy = "DELETE"
187191
}
188192

189193
/******************************************

examples/simple_project/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ module "project-factory" {
3131
"roles/bigquery.jobUser",
3232
]
3333
}]
34+
35+
deletion_policy = "DELETE"
3436
}

0 commit comments

Comments
 (0)