Last year, we released the Cloud Foundation Toolkit, open source templates that help you quickly build a strong cloud foundation according to best practices. These modules are available for both the Terraform infrastructure-as-code framework, as well as our own Cloud Deployment Manager.

This blog post will detail building a secure cloud foundation using the Cloud Foundation Toolkit Terraform example foundation. From there, we will explore how to deploy a microservices demo application onto the foundation using Terraform. After reading this content, we hope you learn how to accomplish the following:

  • Reduce the time required to build out an enterprise cloud foundation to less than one day following Google best practices
  • Use your cloud foundation by deploying a demo Google Kubernetes Engine (GKE) workload onto the foundation using Terraform
  • Deploy a GKE cluster at the highest level of security based on Google expert recommendations (IAP with TCP forwarding bastion host)

Getting started

To get started with using the Cloud Foundation Toolkit, first you need to understand Terraform and Linux command line basics. Then, you will need to make sure you have the following prerequisites.

Prerequisites:

  1. A GCP Organization
  2. A GCP Billing Account
  3. Ability to create Cloud Identity / G Suite groups
  4. Linux command line access with the following installed and configured:
  5. Google Cloud SDK
  6. Terraform
  7. Git

Building out a cloud foundation

First, you will need to clone the Terraform example foundation repository.

Git clone[https://github.com/terraform-google-modules/terraform-example-foundation.git](https://github.com/terraform-google-modules/terraform-example-foundation.git)

This repo contains several distinct Terraform projects each within their own directory that must be applied separately, but in sequence. Each of these Terraform projects are to be layered on top of each other, running in the following order.

0-bootstrap: The purpose of this step is to bootstrap a GCP organization, creating all the required resources & permissions to start using the Cloud Foundation Toolkit (CFT). This step also configures Cloud Build & Cloud Source Repositories for foundations code in subsequent stages.

#google cloud platform #devops & sre

Using the Cloud Foundation Toolkit with Terraform
10.90 GEEK