Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/job-exec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <pre>object({<br/> name = optional(string, null)<br/> version = optional(string, null)<br/> })</pre> | `{}` | 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 |
Expand Down
12 changes: 7 additions & 5 deletions modules/job-exec/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions modules/job-exec/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}