File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -549,6 +549,30 @@ resource "google_cloud_scheduler_job" "gbfs_validator_batch_scheduler" {
549549 attempt_deadline = " 320s"
550550}
551551
552+ # Schedule the JBDA import function to run monthly
553+ resource "google_cloud_scheduler_job" "jbda_import_schedule" {
554+ name = " jbda-import-scheduler-${ var . environment } "
555+ description = " Schedule the jbda import function"
556+ time_zone = " Etc/UTC"
557+ schedule = var. jbda_scheduler_schedule
558+ region = var. gcp_region
559+ paused = var. environment == " prod" ? false : true
560+ depends_on = [google_cloudfunctions2_function . tasks_executor , google_cloudfunctions2_function_iam_member . tasks_executor_invoker ]
561+ http_target {
562+ http_method = " POST"
563+ uri = google_cloudfunctions2_function. tasks_executor . url
564+ oidc_token {
565+ service_account_email = google_service_account. functions_service_account . email
566+ }
567+ headers = {
568+ " Content-Type" = " application/json"
569+ }
570+ body = base64encode (" {\" task_name\" : \" jbda_import\" , \" payload\" : {\" dry_run\" : \" false\" }}" )
571+ }
572+ attempt_deadline = " 320s"
573+ }
574+
575+
552576resource "google_cloud_scheduler_job" "transit_land_scraping_scheduler" {
553577 name = " transitland-scraping-scheduler-${ var . environment } "
554578 description = " Schedule the transitland scraping function"
Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ variable "gbfs_scheduler_schedule" {
6565 default = " 0 0 * * *" # At 00:00 every day
6666}
6767
68+ variable "jbda_scheduler_schedule" {
69+ type = string
70+ description = " Schedule for the JBDA scheduler job"
71+ default = " 0 0 3 * *" # At 00:00 on the 3rd day of every month
72+ }
73+
6874variable "transitland_scraping_schedule" {
6975 type = string
7076 description = " Schedule Transitland scraping job"
You can’t perform that action at this time.
0 commit comments