From 5e3caea464475ff93f72319407bf5d1280f0d5ba Mon Sep 17 00:00:00 2001 From: harrison-carter Date: Mon, 23 Mar 2026 10:40:14 +0000 Subject: [PATCH] feat: pass approval_required variable through cloud-function-gen2 module - Add `approval_required` boolean variable to the cloud-function-gen2 module, defaulting to `false` - Wire the variable through to the Cloud Build trigger resource in `main.tf` --- gcp/cloud-function-gen2/main.tf | 1 + gcp/cloud-function-gen2/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/gcp/cloud-function-gen2/main.tf b/gcp/cloud-function-gen2/main.tf index 19f61a1..78f3bf3 100644 --- a/gcp/cloud-function-gen2/main.tf +++ b/gcp/cloud-function-gen2/main.tf @@ -178,6 +178,7 @@ module "trigger_provision" { name = "function-${var.function_name}-provision" description = "Provision ${var.function_name} Service (CI/CD)" source = "../cloud-cloudbuild-trigger" + approval_required = var.approval_required trigger_service_account = var.trigger_service_account location = var.location filename = var.function_path == "" ? "services/${var.service_name}/functions/${var.function_name}/cloudbuild.yaml" : "${var.function_path}/cloudbuild.yaml" diff --git a/gcp/cloud-function-gen2/variables.tf b/gcp/cloud-function-gen2/variables.tf index 05b9a34..d6b105f 100644 --- a/gcp/cloud-function-gen2/variables.tf +++ b/gcp/cloud-function-gen2/variables.tf @@ -203,3 +203,9 @@ variable "node_version" { description = "Default Node.js runtime version for deployed functions" default = "nodejs16" } + +variable "approval_required" { + type = bool + default = false + description = "If true, Cloud Build trigger will require manual approval before executing." +}