Skip to content

Commit

Permalink
Add deletion_policy to project module (#2502)
Browse files Browse the repository at this point in the history
* Replace skip_delete with deletion_policy

* Fix blueprints

* Update apigee blueprint readme

* Remove skip_delete from test inventories
  • Loading branch information
juliocc authored Aug 16, 2024
1 parent 3cf8889 commit 0420dec
Show file tree
Hide file tree
Showing 128 changed files with 283 additions and 264 deletions.
2 changes: 1 addition & 1 deletion blueprints/apigee/apigee-x-foundations/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blueprints/apigee/apigee-x-foundations/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "project" {
compute_metadata = var.project_config.compute_metadata
custom_roles = var.project_config.custom_roles
default_service_account = var.project_config.default_service_account
deletion_policy = var.project_config.deletion_policy
iam = var.project_config.iam
iam_bindings = var.project_config.iam_bindings
iam_bindings_additive = var.project_config.iam_bindings_additive
Expand Down Expand Up @@ -51,7 +52,6 @@ module "project" {
] : []))

shared_vpc_service_config = var.project_config.shared_vpc_service_config
skip_delete = var.project_config.skip_delete
tag_bindings = var.project_config.tag_bindings
}

Expand Down
2 changes: 1 addition & 1 deletion blueprints/apigee/apigee-x-foundations/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ variable "project_config" {
contacts = optional(map(list(string)), {})
custom_roles = optional(map(list(string)), {})
default_service_account = optional(string, "keep")
deletion_policy = optional(string)
descriptive_name = optional(string)
iam = optional(map(list(string)), {})
group_iam = optional(map(list(string)), {})
Expand Down Expand Up @@ -382,7 +383,6 @@ variable "project_config" {
service_agent_iam = optional(map(list(string)), {})
service_iam_grants = optional(list(string), [])
}))
skip_delete = optional(bool, false)
tag_bindings = optional(map(string))
})
}
Expand Down
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/autopilot-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/batch/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/kafka/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
3 changes: 1 addition & 2 deletions blueprints/gke/patterns/kong-cloudrun/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ module "service-project" {
shared_vpc_service_config = {
host_project = var.project_id
}
skip_delete = true
}
}
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/kong-cloudrun/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/mysql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions blueprints/gke/patterns/redis-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 0 additions & 4 deletions blueprints/serverless/cloud-run-corporate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ module "project_main" {
"cloudresourcemanager.googleapis.com",
"accesscontextmanager.googleapis.com"
]
skip_delete = true
}

# Simulated onprem environment
Expand All @@ -75,7 +74,6 @@ module "project_onprem" {
"compute.googleapis.com",
"dns.googleapis.com"
]
skip_delete = true
}

# Project 1
Expand All @@ -90,7 +88,6 @@ module "project_prj1" {
"compute.googleapis.com",
"dns.googleapis.com"
]
skip_delete = true
}

# Service Project 1
Expand Down Expand Up @@ -118,7 +115,6 @@ module "project_svc1" {
"run.googleapis.com",
"vpcaccess.googleapis.com"
]
skip_delete = true
}

###############################################################################
Expand Down
4 changes: 1 addition & 3 deletions blueprints/serverless/cloud-run-microservices/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,6 @@ module "main-project" {
"dns.googleapis.com",
"vpcaccess.googleapis.com"
]
skip_delete = true
}

module "service-project" {
Expand All @@ -60,5 +59,4 @@ module "service-project" {
"compute.googleapis.com",
"run.googleapis.com",
]
skip_delete = true
}
4 changes: 2 additions & 2 deletions default-versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/__experimental_deprecated/net-neg/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/alloydb/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/analytics-hub/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/api-gateway/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/apigee/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/artifact-registry/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/bigquery-dataset/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/bigtable-instance/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/billing-account/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/binauthz/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/certificate-authority-service/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
4 changes: 2 additions & 2 deletions modules/certificate-manager/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.40.0, < 6.0.0" # tftest
version = ">= 5.41.0, < 6.0.0" # tftest
}
}
}
Loading

0 comments on commit 0420dec

Please sign in to comment.