Add a project_skip_delete variable to optionally let the project stick around after the resources are destroyed.

This commit is contained in:
Christopher Avila
2021-11-01 10:31:13 -05:00
parent 305746ac97
commit 88c6af3dbb
3 changed files with 8 additions and 0 deletions

View File

@@ -200,6 +200,7 @@ module "project" {
| *policy_list* | Map of list org policies, status is true for allow, false for deny, null for restore. Values can only be used for allow or deny. | <code title="map&#40;object&#40;&#123;&#10;inherit_from_parent &#61; bool&#10;suggested_value &#61; string&#10;status &#61; bool&#10;values &#61; list&#40;string&#41;&#10;&#125;&#41;&#41;">map(object({...}))</code> | | <code title="">{}</code> |
| *prefix* | Prefix used to generate project id and name. | <code title="">string</code> | | <code title="">null</code> |
| *project_create* | Create project. When set to false, uses a data source to reference existing project. | <code title="">bool</code> | | <code title="">true</code> |
| *project_skip_delete* | Allows the underlying resources to be destroyed without destroying the project itself. | <code title="">bool</code> | | <code title="">false</code> |
| *service_config* | Configure service API activation. | <code title="object&#40;&#123;&#10;disable_on_destroy &#61; bool&#10;disable_dependent_services &#61; bool&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;disable_on_destroy &#61; true&#10;disable_dependent_services &#61; true&#10;&#125;">...</code> |
| *service_encryption_key_ids* | Cloud KMS encryption key in {SERVICE => [KEY_URL]} format. | <code title="map&#40;list&#40;string&#41;&#41;">map(list(string))</code> | | <code title="">{}</code> |
| *service_perimeter_bridges* | Name of VPC-SC Bridge perimeters to add project into. Specify the name in the form of 'accessPolicies/ACCESS_POLICY_NAME/servicePerimeters/PERIMETER_NAME'. | <code title="list&#40;string&#41;">list(string)</code> | | <code title="">null</code> |

View File

@@ -91,6 +91,7 @@ resource "google_project" "project" {
billing_account = var.billing_account
auto_create_network = var.auto_create_network
labels = var.labels
skip_delete = var.project_skip_delete
}
resource "google_project_iam_custom_role" "roles" {

View File

@@ -162,6 +162,12 @@ variable "project_create" {
default = true
}
variable "project_skip_delete" {
description = "Allows the underlying resources to be destroyed without destroying the project itself."
type = bool
default = false
}
variable "service_config" {
description = "Configure service API activation."
type = object({