Skip to main content

Google Cloud Solutions Template

A solution framework to generate a new project with built-in structure and modules to accelerate your project setup.

TL;DR

Solutions Template is a boilerplate template for building repeatable solutions with the best practices in architecture on Google Cloud, including GKE clusters, Cloud Run, Test Automation, CI/CD, as well as development process.

This template provides built-in and ready-to-ship modules including:

  • Easy-to-deploy Terraform boilerplate modules
  • Container-based microservices, can be deployed to a Kubernetes cluster or Cloud Run.
  • Unified deployment using Skaffold.
  • Automatically generated API documentation with Swagger UI.
  • CI/CD deployment (with Github Actions).
  • Cloud Run templates.

Roadmap

Please see Feature Requests in the Github issue list.

Prerequisite

Tool Required Version Installation
Python >= 3.9
gcloud CLI Latest https://cloud.google.com/sdk/docs/install
Terraform >= v1.3.7 https://developer.hashicorp.com/terraform/downloads
Skaffold >= v2.4.0 https://skaffold.dev/docs/install/

[Optional] If you plan to deploy services on a GKE cluster, please install the following:

Tool Required Version Installation
Kustomize >= v5.0.0 https://kubectl.docs.kubernetes.io/installation/kustomize/

Installing Solutions Template CLI

With pip:

pip install solutions-template

With pipx:

pip install --user pipx
pipx install solutions-template

Getting Started

Set up GCP project

# Optional: create a new GCP project. You can also use an existing GCP project.
gcloud projects create my-solution-gcp-id

# Set gcloud CLI to the GCP project.
gcloud config set project my-solutions-gcp-id

Generate a new solution folder.

st new my-solution .

This will prompt options and variables:

🎤 What is your project name? (Spaces are allowed.)
   my-solution
🎤 What is your Google Cloud project ID?
   my-solution-gcp-id
🎤 What is your Google Cloud project number?
   12345678
🎤 Which Google Cloud region?
   us-central1
🎤 Use GCS Bucket for Terraform backend?
   Yes

Go to the newly created project folder and initialize the solution.

cd my-solution
st infra init

Add a RESTful API service with Todo data model to this solution.

st components add restful_service

Fill details in the prompt:

  • Component name: todo_service
  • Resource name: todo-service
  • Relative path: todo-service
  • GCP region: us-central1
  • Data model name: todo
  • Add Cloud Run to deployment methods: yes
  • Create network endpoint group (NEG) for serverless ingress: yes
  • Default deploy method? (cloudrun or gke): Cloud Run

Add a HTTP Load Balancer for Cloud Run service(s)

st add component terraform_httplb_cloudrun
st infra apply 3-httplb-cloudrun

Build and deploy

st deploy

Additional Documentations

You can find more documentations in docs folder. In a nutshell, it covers the following:

In the docs/components folder, it contains a few more guidance based on each component/feature available in this template.

  • gke.md covers the overall developmeng guidance on Google Kubernetes Engine.
  • cloudrun.md covers the guidance if you want to deploy microservice to Cloud Run.

FAQ

  • Who are the target audience/users for this Solutions template?

    • A: Any engineering team to start a new solution development project.
  • Can I choose to deploy microservice just to Cloud Run?

  • Can I use this template for non-Google or multi-Cloud environments?

    • A: We design this Solutions Template to work 100% out of the box with Google Cloud products. However you could customize the solution to meet your needs on multi-Cloud environment. See Why Google Cloud for details.

Troubleshoot

See TROUBLESHOOTING.md for details.

Metadata

Release files for solutions-template 1.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solutions-template 1.14.0
File Size Uploaded
solutions_template-1.14.0.tar.gz 359.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solutions-template 1.14.0
File Interpreter ABI Platform
solutions_template-1.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 809.7 kB

Release files / solutions_template-1.14.0.tar.gz

Download URL solutions_template-1.14.0.tar.gz
Size 359.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7078d1483a5b3b7c27f2d1380eb7c2482e7cb89dbc830bf5b6826eff57c1e48f
BLAKE2b-256 checksum
How to use checksums
2d4dc540e1a6eb35cf8621d21aa6a265766dfd2917f02993b40ac51b044085cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Darwin/22.6.0

Release files / solutions_template-1.14.0-py3-none-any.whl

Download URL solutions_template-1.14.0-py3-none-any.whl
Size 450.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16eb95aafcc495fe34f2f3ef929693c7b3e22c4eb94c5f64ab2abcfa286d2de6
BLAKE2b-256 checksum
How to use checksums
443720ad1392c94ca11ceb8d78eb4984e17e749047252fc8ec5b0fd8dc285f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Darwin/22.6.0

Release history Release notifications | RSS feed

This release

1.14.0 This release

2 release files

1.13.0

2 release files

1.12.0

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

0.1.16

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page