Small project to schedule on/off for my gcp instance using cloud function + GAE cron job
While using cloud functions, GAE do not requires IAM config.
- Install dependencies
pip install -r requirements.txt -t lib
- Setup environment variables
# Cloudfunction endpoint format https://[region]-[projectid].cloudfunctions.net/
export GCP_CLOUDFUNCTION_URL=<Endpoint to cloudfunctions>
export GCP_DEFAULT_ZONE=<default zone>
export GCP_INSTANCE_NAME=<the instance name>
- Run deployment script
You need to setup Cloud SDK and App Engine SDK for Python.
Local deployment
# Deploy app on local port 8080
deploy.sh local 8080
GAE deployment
# Deploy app in GAE project abcxyz-123
deploy.sh remote abcxyz-123