Skip to content

Commit

Permalink
feat(TPG>=5.41)!: add deletion_policy (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Sep 6, 2024
1 parent 7414025 commit b0ed8a5
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ determining that location is as follows:
| create\_project\_sa | Whether the default service account for the project shall be created | `bool` | `true` | no |
| 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 |
| default\_service\_account | Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`. | `string` | `"disable"` | no |
| deletion\_policy | The deletion policy for the project. | `string` | `null` | no |
| 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 |
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | `bool` | `true` | no |
| domain | The domain name (optional). | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module "project-factory" {
default_network_tier = var.default_network_tier
tag_binding_values = var.tag_binding_values
cloud_armor_tier = var.cloud_armor_tier
deletion_policy = var.deletion_policy
}

/******************************************
Expand Down
1 change: 1 addition & 0 deletions modules/core_project_factory/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ resource "google_project" "main" {
folder_id = local.project_folder_id
billing_account = var.billing_account
auto_create_network = var.auto_create_network
deletion_policy = var.deletion_policy

labels = var.labels

Expand Down
6 changes: 6 additions & 0 deletions modules/core_project_factory/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,9 @@ variable "cloud_armor_tier" {
type = string
default = null
}

variable "deletion_policy" {
description = "The deletion policy for the project."
type = string
default = null
}
4 changes: 2 additions & 2 deletions modules/core_project_factory/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.33, < 6"
version = ">= 5.41, < 6"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.33, < 6"
version = ">= 5.41, < 6"
}
null = {
source = "hashicorp/null"
Expand Down
1 change: 1 addition & 0 deletions modules/fabric-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module "project_myproject" {
| auto\_create\_network | Whether to create the default network for the project | `bool` | `false` | no |
| billing\_account | Billing account id. | `string` | `""` | no |
| custom\_roles | Map of role name => comma-delimited list of permissions to create in this project. | `map(string)` | `{}` | no |
| deletion\_policy | The deletion policy for the project. | `string` | `null` | no |
| editors | Optional list of IAM-format members to set as project editor. | `list(string)` | `[]` | no |
| extra\_bindings\_members | List of comma-delimited IAM-format members for additional IAM bindings, one item per role. | `list(string)` | `[]` | no |
| extra\_bindings\_roles | List of roles for additional IAM bindings, pair with members list below. | `list(string)` | `[]` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/fabric-project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ resource "google_project" "project" {
billing_account = var.billing_account
auto_create_network = var.auto_create_network
labels = var.labels
deletion_policy = var.deletion_policy
}

resource "google_project_service" "project_services" {
Expand Down
5 changes: 5 additions & 0 deletions modules/fabric-project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ variable "labels" {
default = {}
}

variable "deletion_policy" {
description = "The deletion policy for the project."
type = string
default = null
}
2 changes: 1 addition & 1 deletion modules/fabric-project/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.43, < 6"
version = ">= 5.41, < 6"
}
}
provider_meta "google" {
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,14 @@ variable "tag_binding_values" {
default = []
}


variable "cloud_armor_tier" {
description = "Managed protection tier to be set. Possible values are: CA_STANDARD, CA_ENTERPRISE_PAYGO"
type = string
default = null
}

variable "deletion_policy" {
description = "The deletion policy for the project."
type = string
default = null
}
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.33, < 6"
version = ">= 5.41, < 6"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.33, < 6"
version = ">= 5.41, < 6"
}
}
provider_meta "google" {
Expand Down

0 comments on commit b0ed8a5

Please sign in to comment.