Deploy scheduled Cloud Build runs via Cloud Scheduler with Terraform

Introduction I recently had to deploy a scheduled Cloud Build job for a project at work. As this can be easily done through the GCP console, I was expecting to find a cloudbuild_target argument in the google_cloud_scheduler_job resource which unfortunately was not the case^. The solution The idea is to define a google_cloud_scheduler_job with a HTTP target since each build trigger comes with its own REST API URL. The URL takes a triggerId as path parameter, which can be retrieved using the below commands....

May 29, 2022 · 2 min