Skip to content

Instantly share code, notes, and snippets.

@sabatale
sabatale / README.md
Last active June 14, 2021 21:51 — forked from lovromazgon/README.md
Schedule starting/stopping a CloudSQL instance on GCP

To use this cloud function follow these steps:

  1. Create a pub/sub topic which will be used to trigger the cloud function.
  2. Create the cloud function and copy in the code below.
    1. Set the trigger to Pub/Sub and choose the topic created in step 1.
    2. Set the Runtime to Python 3.9 and delete default files.
    3. Create each file manually and paste the code.
    4. Make sure to set the correct project ID in line 8.
  3. Create a cloud scheduler job to trigger the cloud function on a regular basis.
    1. Choose the frequency when you want the cloud function to be triggered.
  4. Set the target to Pub/Sub and define the topic created in step 1.
[{"iata":"AAA","name":"Anaa Airport"},{"iata":"AAB","name":"Arrabury Airport"},{"iata":"AAC","name":"El Arish International Airport"},{"iata":"AAE","name":"Annaba Airport"},{"iata":"AAF","name":"Apalachicola Regional Airport"},{"iata":"AAG","name":"Arapoti Airport"},{"iata":"AAH","name":"Aachen-Merzbruck Airport"},{"iata":"AAI","name":"Arraias Airport"},{"iata":"AAJ","name":"Cayana Airstrip"},{"iata":"AAK","name":"Buariki Airport"},{"iata":"AAL","name":"Aalborg Airport"},{"iata":"AAM","name":"Malamala Airport"},{"iata":"AAN","name":"Al Ain International Airport"},{"iata":"AAO","name":"Anaco Airport"},{"iata":"AAQ","name":"Anapa Airport"},{"iata":"AAR","name":"Aarhus Airport"},{"iata":"AAT","name":"Altay Air Base"},{"iata":"AAU","name":"Asau Airport"},{"iata":"AAV","name":"Allah Valley Airport"},{"iata":"AAW","name":"Abbottabad Airport"},{"iata":"AAX","name":"Araxa Airport"},{"iata":"AAY","name":"Al Ghaidah International Airport"},{"iata":"AAZ","name":"Quezaltenango Airport"},{"iata":"ABA","name":"Abakan Airpo