Skip to content

Commit b0ed8a5

Browse files
authored
feat(TPG>=5.41)!: add deletion_policy (#938)
1 parent 7414025 commit b0ed8a5

File tree

11 files changed

+27
-6
lines changed

11 files changed

+27
-6
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +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 |
140141
| 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 |
141142
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | `bool` | `true` | no |
142143
| domain | The domain name (optional). | `string` | `""` | no |

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module "project-factory" {
7171
default_network_tier = var.default_network_tier
7272
tag_binding_values = var.tag_binding_values
7373
cloud_armor_tier = var.cloud_armor_tier
74+
deletion_policy = var.deletion_policy
7475
}
7576

7677
/******************************************

modules/core_project_factory/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ resource "google_project" "main" {
7777
folder_id = local.project_folder_id
7878
billing_account = var.billing_account
7979
auto_create_network = var.auto_create_network
80+
deletion_policy = var.deletion_policy
8081

8182
labels = var.labels
8283

modules/core_project_factory/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,9 @@ variable "cloud_armor_tier" {
276276
type = string
277277
default = null
278278
}
279+
280+
variable "deletion_policy" {
281+
description = "The deletion policy for the project."
282+
type = string
283+
default = null
284+
}

modules/core_project_factory/versions.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 5.33, < 6"
23+
version = ">= 5.41, < 6"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 5.33, < 6"
27+
version = ">= 5.41, < 6"
2828
}
2929
null = {
3030
source = "hashicorp/null"

modules/fabric-project/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +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 |
4142
| editors | Optional list of IAM-format members to set as project editor. | `list(string)` | `[]` | no |
4243
| extra\_bindings\_members | List of comma-delimited IAM-format members for additional IAM bindings, one item per role. | `list(string)` | `[]` | no |
4344
| extra\_bindings\_roles | List of roles for additional IAM bindings, pair with members list below. | `list(string)` | `[]` | no |

modules/fabric-project/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ resource "google_project" "project" {
3535
billing_account = var.billing_account
3636
auto_create_network = var.auto_create_network
3737
labels = var.labels
38+
deletion_policy = var.deletion_policy
3839
}
3940

4041
resource "google_project_service" "project_services" {

modules/fabric-project/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,8 @@ variable "labels" {
122122
default = {}
123123
}
124124

125+
variable "deletion_policy" {
126+
description = "The deletion policy for the project."
127+
type = string
128+
default = null
129+
}

modules/fabric-project/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 3.43, < 6"
23+
version = ">= 5.41, < 6"
2424
}
2525
}
2626
provider_meta "google" {

variables.tf

+6-1
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,14 @@ variable "tag_binding_values" {
360360
default = []
361361
}
362362

363-
364363
variable "cloud_armor_tier" {
365364
description = "Managed protection tier to be set. Possible values are: CA_STANDARD, CA_ENTERPRISE_PAYGO"
366365
type = string
367366
default = null
368367
}
368+
369+
variable "deletion_policy" {
370+
description = "The deletion policy for the project."
371+
type = string
372+
default = null
373+
}

versions.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ terraform {
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 5.33, < 6"
22+
version = ">= 5.41, < 6"
2323
}
2424
google-beta = {
2525
source = "hashicorp/google-beta"
26-
version = ">= 5.33, < 6"
26+
version = ">= 5.41, < 6"
2727
}
2828
}
2929
provider_meta "google" {

0 commit comments

Comments
 (0)