Search code examples
google-cloud-platformgoogle-compute-enginegoogle-cloud-scheduler

GCP auto shutdown and startup using Google Cloud Schedulers


I want to start/stop a set of Compute engine instances in Google Cloud Platform using Google Cloud Scheduler. How can I do it?


Solution

  • In order to start and stop a Compute Engine using the Cloud Scheduler you can follow Google this tutorial, or this other

    I won’t be copy-pasting the required code here because the tutorial it's very complete but I will resume here the steps to follow.

    1. Set up your Compute Engine instances
    2. Deploy the starter Cloud Function. You can see an example in here
    3. Deploy the stop Cloud Function. You can see an example in here
    4. Set up the Cloud Scheduler jobs

    If you need any help with the tutorial please just let me know!