From ab2b306042d69a231a162fe8d257bc7c37c6a7de Mon Sep 17 00:00:00 2001 From: drewmercer-bl Date: Tue, 29 Apr 2025 09:45:25 -0700 Subject: [PATCH 1/2] feat(main.tf): adding ability to toggle whether service is public or not --- main.tf | 6 ++++-- variables.tf | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index d61217d..ad84ef0 100644 --- a/main.tf +++ b/main.tf @@ -40,11 +40,13 @@ data "google_certificate_manager_certificate_map" "default" { # Backend Serverless Network Endpoint Groups module "serverless_negs" { - for_each = var.services - source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=v1.1.1" + for_each = var.services + #source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=v1.1.1" + source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=enable_public" project_id = var.project_id name = coalesce(each.value.backend["name"], each.key) cloud_run_services = each.value["cloud_run_regions"] + enable_public = each.value.backend["enable_public"] enable_cdn = each.value.backend["enable_cdn"] default_custom_error_response_policy = each.value.backend["default_custom_error_response_policy"] iap_config = each.value.backend["iap_config"] diff --git a/variables.tf b/variables.tf index 0177b05..036c85b 100644 --- a/variables.tf +++ b/variables.tf @@ -164,8 +164,9 @@ variable "services" { name = string })) backend = optional(object({ - name = optional(string) - enable_cdn = optional(bool, false) + name = optional(string) + enable_public = optional(bool, true) + enable_cdn = optional(bool, false) default_custom_error_response_policy = optional(object({ custom_error_responses = optional(list(object({ match_response_codes = optional(list(string)) From 9d04c55b32f4d0bbf2db42f74cb7bb37e72101e5 Mon Sep 17 00:00:00 2001 From: drewmercer-bl Date: Tue, 29 Apr 2025 14:31:27 -0700 Subject: [PATCH 2/2] Updating Readme --- README.md | 12 ++++++++++++ main.tf | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 48521ad..5a5a336 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,18 @@ Details ======= Because Terrraform does not allow you to reference and object inside of an object I utilized submodules to make sub-object elements available downstream. If more configuration variables are added to the primary object data it's likely they will be need to be passed into the backend modules, then made available as outputs to be used elsewhere. +Contributing +======= +This project uses [Commitizen](https://commitizen-tools.github.io/commitizen/). + +Use the following command to stage a release after adding files with `git commit` + ```bash + git cz + ``` +This will guide you through a series of prompts to format your commit message correctly. + +This only needs to be done once per PR + Authors ======= diff --git a/main.tf b/main.tf index ad84ef0..91fd5be 100644 --- a/main.tf +++ b/main.tf @@ -40,9 +40,8 @@ data "google_certificate_manager_certificate_map" "default" { # Backend Serverless Network Endpoint Groups module "serverless_negs" { - for_each = var.services - #source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=v1.1.1" - source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=enable_public" + for_each = var.services + source = "github.com/brandlive1941/terraform-module-backend-serverless?ref=v1.2.0" project_id = var.project_id name = coalesce(each.value.backend["name"], each.key) cloud_run_services = each.value["cloud_run_regions"]