Skip to content

Commit 98015ec

Browse files
committed
feat!: set new deletion_policy default
1 parent b0ed8a5 commit 98015ec

File tree

18 files changed

+48
-5
lines changed

18 files changed

+48
-5
lines changed

README.md

+1-1
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` | `"RETAIN"` | 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 |
+20
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 `"RETAIN"` 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

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

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

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

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

+2
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/group_project/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ module "project-factory" {
3838
create_group = true
3939
group_name = var.project_group_name
4040
api_sa_group = var.api_sa_group
41+
42+
deletion_policy = "DELETE"
4143
}

examples/project-hierarchy/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ module "project-prod-gke" {
4040
org_id = var.organization_id
4141
billing_account = var.billing_account
4242
folder_id = google_folder.prod.folder_id
43+
44+
deletion_policy = "DELETE"
4345
}
4446

4547
module "project-factory" {

examples/project_services/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ module "project-services" {
3636
"roles/bigquery.jobUser",
3737
]
3838
}]
39+
40+
deletion_policy = "DELETE"
3941
}

examples/quota_project/main.tf

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

+2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ module "service-project-c" {
184184

185185
disable_services_on_destroy = false
186186
grant_network_role = false
187+
188+
deletion_policy = "DELETE"
187189
}
188190

189191
/******************************************

examples/simple_project/main.tf

+2
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
}

examples/tags_project/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ module "project-factory" {
2525
billing_account = var.billing_account
2626
default_service_account = "deprivilege"
2727
tag_binding_values = [var.tag_value]
28+
29+
deletion_policy = "DELETE"
2830
}

modules/core_project_factory/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,5 +280,5 @@ variable "cloud_armor_tier" {
280280
variable "deletion_policy" {
281281
description = "The deletion policy for the project."
282282
type = string
283-
default = null
283+
default = "RETAIN"
284284
}

modules/fabric-project/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "project_myproject" {
3838
| auto\_create\_network | Whether to create the default network for the project | `bool` | `false` | no |
3939
| billing\_account | Billing account id. | `string` | `""` | no |
4040
| custom\_roles | Map of role name => comma-delimited list of permissions to create in this project. | `map(string)` | `{}` | no |
41-
| deletion\_policy | The deletion policy for the project. | `string` | `null` | no |
41+
| deletion\_policy | The deletion policy for the project. | `string` | `"RETAIN"` | no |
4242
| editors | Optional list of IAM-format members to set as project editor. | `list(string)` | `[]` | no |
4343
| extra\_bindings\_members | List of comma-delimited IAM-format members for additional IAM bindings, one item per role. | `list(string)` | `[]` | no |
4444
| extra\_bindings\_roles | List of roles for additional IAM bindings, pair with members list below. | `list(string)` | `[]` | no |

modules/fabric-project/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ variable "labels" {
125125
variable "deletion_policy" {
126126
description = "The deletion policy for the project."
127127
type = string
128-
default = null
128+
default = "RETAIN"
129129
}

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,5 +369,5 @@ variable "cloud_armor_tier" {
369369
variable "deletion_policy" {
370370
description = "The deletion policy for the project."
371371
type = string
372-
default = null
372+
default = "RETAIN"
373373
}

0 commit comments

Comments
 (0)