This repository was inspired by Rob Charlwood's Medium tutorial - "Multi Region Load Balancing with GO and Google Cloud Run - Part 2" and acts as the partner of and infrastructure for the Google Run application "BLMSheet".
To work with this codebase, you will require the below to be setup and configured on your machine.
terraform
at version0.12.28
- Google Cloud SDK (
gcloud
) at version300.0.0
or greater with thebeta
component installed.
To set this codebase up on your machine, you can run the following commands:
git clone git@github.com:jcox-dev/blmsheet-terraform.git
cd blmsheet-terraform
Next up, You'll need your terraform service account key from part 1 of the tutorial placed into a .keys
directory in the root of
this checked out repo.
Then you need to update the terraform.tfvars
with details applicable to your project e.g
project = "multi-region-cloud-run"
region = "europe-west1"
image_name = "multi-region-cloud-run"
image_version = "0.0.1"
registry = "eu.gcr.io"
domain = "example.com"
Finally, you'll need to create a new empty configuration in the gcloud
SDK for terraform work with.
This configuration should be named the same as your Google cloud project since terraform will automatically switch configuration profiles for you in order to run in configuration that cannot yet be provisioned with standard terraform resources.
gcloud config configurations create my-google-project-name
Once all setup above is completed, you can run in the terraform with the below commands to provision all the required infrastructure.
terraform init
terraform plan
terraform apply
For people with a curious nature, the main meat of the infrastructure that makes multi region load balancing possible lies here.
This project uses git for versioning.
- Jamie Cox
- Rob Charlwood - Bitniftee Limited (original)
This project is licensed under the CC0-1.0 License - please see the LICENSE.md file for details