A simple service to get environment configuration from Google Sheet.

Follow the steps below to deploy this service locally as a docker container.

Enable APIs

Go https://developers.google.com/console

Enable Sheet API and Drive API

Create a Service Account

Create a Service Account and download the service-account key in JSON. Rename this key as client-secret.json. Copy client-email for future reference.

Create Google sheet (sheet.new)

Make entries in multiple worksheets.

Image for post

Sample config data

Share the Google sheet with the client-email of Service Account created in the previous step.

Create a Docker container.

Create folder credentials and copy service account (client-secret.json).

Run the following command to create a docker container.

docker run -v $PWD/credentials:/app/credentials -p 8080:8080 vikramshinde/config-service-googlesheet:latest

Hit the API endpoint

localhost:8080/project/<<spreadsheet name>>/env/<<worksheet_name>>/key/<<config_key>>

e.g.
localhost:8080/project/mskproject/env/PROD/key/PROJECT_NAME

#google-cloud-platform #google-cloud-run #serverless #configuration #docker

Config Service using Google Sheet
2.25 GEEK