From d17cfa7f14bbe31c2ddb6aa882a12a83cee4de56 Mon Sep 17 00:00:00 2001 From: Caetano Colin <164910343+caetano-colin@users.noreply.github.com> Date: Wed, 26 Jun 2024 02:35:21 -0300 Subject: [PATCH] feat: add build service account argument (#130) --- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 5876e0e0..ee6b028b 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Functional examples are included in the | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | build\_env\_variables | User-provided build-time environment variables | `map(string)` | `null` | no | +| build\_service\_account | Cloud Function Build Service Account Id. This is The fully-qualified name of the service account to be used for building the container. | `string` | `null` | no | | description | Short description of the function | `string` | `null` | no | | docker\_repository | User managed repository created in Artifact Registry optionally with a customer managed encryption key. | `string` | `null` | no | | entrypoint | The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified | `string` | n/a | yes | diff --git a/main.tf b/main.tf index 60734fb7..4919bd57 100644 --- a/main.tf +++ b/main.tf @@ -28,6 +28,7 @@ resource "google_cloudfunctions2_function" "function" { runtime = var.runtime entry_point = var.entrypoint environment_variables = var.build_env_variables + service_account = var.build_service_account source { dynamic "storage_source" { diff --git a/variables.tf b/variables.tf index daea4d8f..b6f77731 100644 --- a/variables.tf +++ b/variables.tf @@ -155,3 +155,9 @@ variable "members" { error_message = "The supported keys are invokers and developers." } } + +variable "build_service_account" { + type = string + description = "Cloud Function Build Service Account Id. This is The fully-qualified name of the service account to be used for building the container." + default = null +}