I have a Cloud Run Job (apiVersion: run.googleapis.com/v1). When the job finishes successfully, I'd like to trigger a follow-up Cloud Function.
I set up a Terraform google_cloudfunctions2_function with the following trigger config:
event_trigger {
trigger_region = var.region
event_type = "google.cloud.audit.log.v1.written"
retry_policy = "RETRY_POLICY_RETRY"
service_account_email = google_service_account.event.email
event_filters {
attribute = "serviceName"
value = "run.googleapis.com"
}
event_filters {
attribute = "methodName"
value = "google.cloud.run.v1.Jobs.RunJob"
}
...
If I query the Cloud Logs for:
protoPayload.serviceName="run.googleapis.com"
protoPayload.methodName="/Jobs.RunJob"
I can see the events there, but they're not triggering my Cloud Function. Roles are all there and everything is in us-central1.
I tried various methodNamed (/Jobs.RunJob) etc. but I can't figure out why this isn't working?
Thanks
Hi @PatrickNeva,
Welcome to Google Cloud Community!
It seems you're trying to trigger a Cloud Function after a Cloud Run Job using EventArc and Terraform. The events show in Cloud Logs, but the `methodName` filter in your `event_trigger` config is likely blocking it.
Recommendations
These adjustments might help your Cloud Function trigger reliably on Cloud Run Job completion.
I hope the above information is helpful.
Thanks, but there's no `JobExecutionSucceeded`.