Want a two-word explanation of Google Cloud Functions? In this article, I’ll give you a more detailed overview of Google Cloud Functions, compare the 1st gen and 2nd gen environments, and discuss some good uses for the service.
Built on a foundation of Cloud Run (Google Cloud’s serverless container computing product) and Eventarc, a platform-wide triggering service, Cloud Functions 2nd gen capabilities were greatly expanded.
The Google Cloud Functions console allows you to create and deploy a Cloud Function quickly and efficiently.
Deploying a 2nd gen function, triggered by a audit log event such a Cloud SQL instance failover, is just as straight-forward: gcloud functions deploy FUNCTION_NAME --gen2 \ --event-filters="type=google.cloud.audit.log.v1.written" \ --event-filters="serviceName= serviceName=cloudsql.googleapis.com" \ --event-filters="methodName= cloudsql.instances.failover" \ --service-account=PROJECT_NUMBER-compute@developer.gserviceaccount.com