From e02d871d582d8c5cd88a5d780076961103a82a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Thu, 15 Feb 2024 20:15:20 +0000 Subject: [PATCH] fix handling default values --- blueprints/networking/psc-glb-and-armor/README.md | 2 +- blueprints/networking/psc-glb-and-armor/consumer.tf | 4 ++-- .../networking/psc-glb-and-armor/modules/producer/main.tf | 4 ++-- blueprints/networking/psc-glb-and-armor/variables.tf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blueprints/networking/psc-glb-and-armor/README.md b/blueprints/networking/psc-glb-and-armor/README.md index adecfdc0..3a549998 100644 --- a/blueprints/networking/psc-glb-and-armor/README.md +++ b/blueprints/networking/psc-glb-and-armor/README.md @@ -109,7 +109,7 @@ The above command will delete the associated resources so there will be no billa | [producer_a_project_id](variables.tf#L28) | The producer A project, in which the LB, PSC Service Attachment and Cloud Run service should be created. | string | ✓ | | | [producer_b_project_id](variables.tf#L33) | The producer B project, in which the LB, PSC Service Attachment and Cloud Run service should be created. | string | ✓ | | | [region](variables.tf#L47) | The GCP region in which the resources should be deployed. | string | ✓ | | -| [prefix](variables.tf#L22) | Prefix used for resource names. | string | | "" | +| [prefix](variables.tf#L22) | Prefix used for resource names. | string | | null | | [project_create_config](variables.tf#L38) | Create project instead of using an existing one. | object({…}) | | null | ## Outputs diff --git a/blueprints/networking/psc-glb-and-armor/consumer.tf b/blueprints/networking/psc-glb-and-armor/consumer.tf index a52d9cd7..e525046c 100644 --- a/blueprints/networking/psc-glb-and-armor/consumer.tf +++ b/blueprints/networking/psc-glb-and-armor/consumer.tf @@ -19,8 +19,8 @@ module "consumer-project" { name = var.consumer_project_id project_create = var.project_create_config != null - billing_account = try(var.project_create_config.billing_account) - parent = try(var.project_create_config.parent) + billing_account = try(var.project_create_config.billing_account, null) + parent = try(var.project_create_config.parent, null) prefix = var.prefix services = [ "iam.googleapis.com", diff --git a/blueprints/networking/psc-glb-and-armor/modules/producer/main.tf b/blueprints/networking/psc-glb-and-armor/modules/producer/main.tf index c457a106..dd982e8c 100644 --- a/blueprints/networking/psc-glb-and-armor/modules/producer/main.tf +++ b/blueprints/networking/psc-glb-and-armor/modules/producer/main.tf @@ -19,8 +19,8 @@ module "producer-project" { name = var.producer_project_id project_create = var.project_create_config != null - billing_account = try(var.project_create_config.billing_account) - parent = try(var.project_create_config.parent) + billing_account = try(var.project_create_config.billing_account, null) + parent = try(var.project_create_config.parent, null) prefix = var.prefix services = [ "iam.googleapis.com", diff --git a/blueprints/networking/psc-glb-and-armor/variables.tf b/blueprints/networking/psc-glb-and-armor/variables.tf index fb0f58fb..0231a8de 100644 --- a/blueprints/networking/psc-glb-and-armor/variables.tf +++ b/blueprints/networking/psc-glb-and-armor/variables.tf @@ -22,7 +22,7 @@ variable "consumer_project_id" { variable "prefix" { description = "Prefix used for resource names." type = string - default = "" + default = null } variable "producer_a_project_id" {