0
votes

I am trying to create a Google Cloud Scheduler job via the Scheduler API from a cloud function and I want the job that is created to http trigger a cloud function. I read the documentation on PyPi for the cloud scheduler api and it is a bit unclear not to mention it only references app engine. I have to believe that it's not that complicated to have a cloud function create a cloud scheduler job to launch a cloud function. Any help would be greatly appreciated.

1

1 Answers

3
votes

From the best of my understanding, an arbitrary HTTP endpoint can be be triggered. That include a cloud function if you would prefer your cloud function be invoked by HTTP.

You might would like to be sure that the service account under which the Cloud Scheduler runs, has enough permissions to hit the exposed cloud function endpoint. Here are some documentation details: Using authentication with HTTP Targets

As an option, you might prefer to use a pattern: Cloud Scheduler => PubSub Topic => Cloud Function (push triggered from the topic message). I do prefer this way, but the choice depends on your context, requirements and preferences. Here is a question about that choice: Choosing between PubSub Backend Function or Http Function

If you use some cloud function to create a scheduler job, make sure that the service account under which that cloud function is running, has enough IAM permissions in the chosen project for the scheduler job creation.