Google Cloud Pub/Sub message schemas is a feature promising to bring some order into the potential chaos that lurks within a highly event driven architecture. In this post we’re going to investigate using Protocol Buffers as Pub/Sub schemas together with Go and Terraform.
Anyone who has deployed a Google Cloud Function written in Go knows that there are a number of restrictions involved. For example, the highest Go version supported is 1.13. Another example is the lack of built-in support for dependencies when using Go modules. This post covers an approach to handling the latter using Terraform.
This is the second part of a three part series about scheduling Google Cloud Functions, using technologies such as Terraform and Cloud Scheduler. If you haven’t read the first part yet, I suggest you have a glance at it, because it will be the foundation for the things I’m setting out to do here.
In the last article we deployed, and scheduled, a Cloud Function using Pub/Sub, which is the quickest, easiest and recommend way of getting it done. In this article, we’re going to remove the Pub/Sub topic and simply have Cloud Scheduler invoke the Cloud Function directly over HTTP.