From b4e9260a78c22442758450ae317e01b694988e4e Mon Sep 17 00:00:00 2001 From: Felipe Travi Date: Tue, 12 Aug 2025 19:06:21 -0300 Subject: [PATCH 1/2] Feat:add-client-variable-job-exec --- modules/job-exec/main.tf | 12 +++++++----- modules/job-exec/variables.tf | 9 +++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/job-exec/main.tf b/modules/job-exec/main.tf index 8f9f05b6..aca15ae3 100644 --- a/modules/job-exec/main.tf +++ b/modules/job-exec/main.tf @@ -15,11 +15,13 @@ */ resource "google_cloud_run_v2_job" "job" { - name = var.name - project = var.project_id - location = var.location - launch_stage = var.launch_stage - labels = var.labels + name = var.name + project = var.project_id + location = var.location + launch_stage = var.launch_stage + labels = var.labels + client = var.client.name + client_version = var.client.version deletion_protection = var.cloud_run_deletion_protection diff --git a/modules/job-exec/variables.tf b/modules/job-exec/variables.tf index 18c1d14d..6540bdf1 100644 --- a/modules/job-exec/variables.tf +++ b/modules/job-exec/variables.tf @@ -169,3 +169,12 @@ variable "cloud_run_deletion_protection" { description = "This field prevents Terraform from destroying or recreating the Cloud Run v2 Jobs and Services" default = true } + +variable "client" { + type = object({ + name = optional(string, null) + version = optional(string, null) + }) + description = "Arbitrary identifier for the API client and version identifier" + default = {} +} From 59d0c08a0a6ac19abd19a84f6544bdaad151b0ca Mon Sep 17 00:00:00 2001 From: Felipe Travi Date: Mon, 25 Aug 2025 10:20:53 -0300 Subject: [PATCH 2/2] feat:add-client-variable-job-exec --- modules/job-exec/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/job-exec/README.md b/modules/job-exec/README.md index a15a59eb..f31c6d36 100644 --- a/modules/job-exec/README.md +++ b/modules/job-exec/README.md @@ -37,6 +37,7 @@ Functional examples are included in the | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | argument | Arguments passed to the ENTRYPOINT command, include these only if image entrypoint needs arguments | `list(string)` | `[]` | no | +| client | Arbitrary identifier for the API client and version identifier |
object({
name = optional(string, null)
version = optional(string, null)
})
| `{}` | no | | cloud\_run\_deletion\_protection | This field prevents Terraform from destroying or recreating the Cloud Run v2 Jobs and Services | `bool` | `true` | no | | container\_command | Leave blank to use the ENTRYPOINT command defined in the container image, include these only if image entrypoint should be overwritten | `list(string)` | `[]` | no | | create\_service\_account | Create service account for the job. Otherwise, use the default Compute Engine default service account | `bool` | `false` | no |