Rodrigo
Rodrigo

Reputation: 321

Eventarc google.cloud.scheduler.v1beta1.CloudScheduler.RunJob not being triggered

I have a trigger on Eventarc that is supposed to run after each Cloud Scheduler invocation, which is google.cloud.scheduler.v1beta1.CloudScheduler.RunJob

However, it is not being triggered anyhow!

Other triggers, like force run, are working.

I want to trigger a Cloud Run after a Job execution. Is it possible or I am facing a bug?

enter image description here

Upvotes: 3

Views: 585

Answers (1)

ErnestoC
ErnestoC

Reputation: 2904

If you are expecting your Cloud Run service to be executed at each scheduled invocation of Cloud Scheduler, it isn't possible to do so through Eventarc and Cloud Audit logs.

This is due to Cloud Scheduler not being in the list of services that write audit logs. Adding to that, the RunJob event you are filtering by will only get written if you manually execute a job (using the API), and not by your set CRON schedule.

A manual job run did trigger Eventarc when I tested this scenario, but I had to set my trigger as global.

If you would like to execute the Cloud Run service on a schedule, you can do that by having Cloud Scheduler send a request to the service URL directly. Another alternative is to instead of having Eventarc listen to Audit logs, have it listen to messages on a Pub/Sub topic, which will be sent by Cloud Scheduler. Let me know if this was helpful.

Upvotes: 4

Related Questions