The reference agent's subject, cloud solution architecture, as an agent in the operating model agent's pattern: the Execution engine (from orchestration_engine) and one Workflow in app/solution_architecture, built for the settings and provider bundle by assembly.workflow_for. Copied from gcp_solution_architecture_agent at 8b397cd without its own engine: its role files, Skills, provider bundle, ADRs, vocabulary, scripts and evaluation datasets. The image takes the engine from a named build context and installs Terraform. It is called through the Orchestration engine, and its files are what the operating model agent digests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.0 KiB
2.0 KiB
Cloud Scheduler
A schedule that starts a Cloud Run job, and one that calls a private Cloud Run service.
- A job is started by an HTTP POST to its
:runmethod with an OAuth token (oauth_token). A service is called with an OIDC token (oidc_token). Using the wrong one is refused at run time, not byterraform validate. - The schedule's service account needs
roles/run.invokeron the job or service it starts. scheduleis unix-cron;time_zoneis an IANA name.
variable "project_id" {
type = string
description = "Project to deploy into."
}
variable "region" {
type = string
description = "Region for regional resources."
}
variable "job_name" {
type = string
description = "Name of the Cloud Run job to start."
}
variable "service_url" {
type = string
description = "HTTPS URL of the private Cloud Run service to call."
}
resource "google_service_account" "scheduler" {
project = var.project_id
account_id = "nightly-scheduler"
display_name = "Identity of the nightly schedules"
}
resource "google_cloud_scheduler_job" "start_job" {
project = var.project_id
region = var.region
name = "start-nightly-job"
schedule = "0 2 * * *"
time_zone = "Etc/UTC"
attempt_deadline = "180s"
retry_config {
retry_count = 3
}
http_target {
http_method = "POST"
uri = "https://run.googleapis.com/v2/projects/${var.project_id}/locations/${var.region}/jobs/${var.job_name}:run"
oauth_token {
service_account_email = google_service_account.scheduler.email
}
}
}
resource "google_cloud_scheduler_job" "call_service" {
project = var.project_id
region = var.region
name = "call-nightly-service"
schedule = "30 2 * * *"
time_zone = "Etc/UTC"
http_target {
http_method = "POST"
uri = "${var.service_url}/tasks/nightly"
oidc_token {
service_account_email = google_service_account.scheduler.email
audience = var.service_url
}
}
}