Skip to content

Commit c21a7e3

Browse files
authored
[๐Ÿ”ฅAUDIT๐Ÿ”ฅ] Make job_name not required for scheduled functions (#11)
๐Ÿ– _This is an audit!_ ๐Ÿ– ## Summary: This should be required for scheduled functions and shouldn't be required for cloud run jobs. Issue: INFRA-XXXX ## Test plan: update culture-cron to pull this in Author: jwbron Auditors: csilvers Required Reviewers: Approved By: Checks: โœ… 1 check was successful Pull Request URL: #11
1 parent 379027c commit c21a7e3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

โ€Žterraform/modules/scheduled-job/main.tfโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ resource "google_cloud_run_v2_job" "job" {
160160
name = var.job_name
161161
location = var.region
162162

163+
lifecycle {
164+
precondition {
165+
condition = var.job_image != null
166+
error_message = "job_image is required when execution_type is 'job'."
167+
}
168+
}
169+
163170
template {
164171
task_count = var.job_task_count
165172
parallelism = var.job_parallelism

โ€Žterraform/modules/scheduled-job/variables.tfโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,5 @@ variable "job_args" {
192192
variable "job_image" {
193193
description = "Container image URL for the Cloud Run Job (e.g., 'gcr.io/project-id/job-name:latest')"
194194
type = string
195+
default = null
195196
}
196-

0 commit comments

Comments
ย (0)