Recently I created an app config-service that fetches the config data from Google Sheet. This app was deployed using GCP serverless services Cloud Source Repository, Cloud Build, Container Registry, and Cloud Run.
In this article, we will see how to automate this CI/CD pipeline using Terraform.
In order to complete this guide, you’ll need to install the following tools
Create a GCP project for this tutorial.
Everything is setup now. Let the wheels roll !!
Clone the following repository containing the sample code, then switch to the terraform
directory:
$ git clone https://github.com/vikramshinde12/config-service-googlesheet.git
$ cd config-service-googlesheet/terraform
Next, copy the terrform.tfvars.example
file to terraform.tfvars
. You will need to replace the value of the project
variables.
Then, copy the service account key terraform-key.json to this folder.
Execute following command to set Google Credentials.
$ export GOOGLE_CLOUD_KEYFILE_JSON=terraform-key.json
Execute Terraform scripts
First initialize the Terraform.
$ terraform init
Initializing Terraform
$ terraform plan
#automation #terraform #google-cloud-platform #google-cloud-run #devops