diff --git a/modules/job-exec/README.md b/modules/job-exec/README.md index c7061bae..62cb36dc 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 |
diff --git a/modules/job-exec/main.tf b/modules/job-exec/main.tf
index be71a47a..56764cb7 100644
--- a/modules/job-exec/main.tf
+++ b/modules/job-exec/main.tf
@@ -66,11 +66,13 @@ resource "google_project_iam_member" "roles" {
}
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 6f1b76d4..fbc45945 100644
--- a/modules/job-exec/variables.tf
+++ b/modules/job-exec/variables.tf
@@ -181,3 +181,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 = {}
+}