variable "project_id" { type = string default = "rational-timing-443808-u0" } variable "region" { type = string default = "asia-northeast1" } variable "function_name" { type = string default = "generate-minutes" } # 毎日3時に Function を実行する Scheduler ジョブ resource "google_cloud_scheduler_job" "daily_cf_trigger" { project = var.project_id name = "daily-cf-trigger" description = "Invoke Cloud Function everyday at 03:00" region = var.region schedule = "0 3 * * *" time_zone = "Asia/Tokyo" http_target { uri = "https://${var.region}-${var.project_id}.cloudfunctions.net/${var.function_name}/api/dailyBatch" http_method = "POST" oidc_token { service_account_email = google_service_account.cf_scheduler_sa.email audience = "https://${var.region}-${var.project_id}.cloudfunctions.net/${var.function_name}" } } }