Cloud Foundation Toolkit (CFT) is a set of reference templates that reflect Google Cloud best practices. CFT-provided templates can be used to quickly build repeatable enterprise-ready environments in Google Cloud. CFT can be deployed using Deployment Manager or Terraform. Google Cloud provides Terraform blueprints and modules that can be used immediately.
For the list of all blueprints, go to https://cloud.google.com/docs/terraform/blueprints/terraform-blueprints.
Let’s check one of the templates and examine the settings we can configure in it. I’ve selected the Cloud VPN template available at https://github.com/terraform-google-modules/terraform-google-vpn.
As we learned in the previous section, the main.tf file will consist of the main code for our template:
resource “google_compute_router” “cr-uscentral1-to-prod-vpc” {
name = “cr-uscentral1-to-prod-vpc-tunnels”
region = “us-central1”
network = “default”
project = var.project_id
bgp {
asn = “64519”
}
}
module “vpn-prod-internal” {
source = “terraform-google-modules/vpn/google”
version = “~> 1.2.0”
project_id = var.project_id
network = “default”
region = “us-west1”
gateway_name = “vpn-prod-internal”
tunnel_name_prefix = “vpn-tn-prod-internal”
shared_secret = “secrets”
tunnel_count = 1
peer_ips = [“1.1.1.1”, “2.2.2.2”]
route_priority = 1000
remote_subnet = [“10.17.0.0/22”, “10.16.80.0/24”]
}
module “vpn-manage-internal” {
source = “terraform-google-modules/vpn/google”
version = “~> 1.2.0”
project_id = var.project_id
network = “default”
region = “us-west1”
gateway_name = “vpn-manage-internal”
tunnel_name_prefix = “vpn-tn-manage-internal”
shared_secret = “secrets”
tunnel_count = 1
peer_ips = [“1.1.1.1”, “2.2.2.2”]
route_priority = 1000
remote_subnet = [“10.17.32.0/20”, “10.17.16.0/20”]
}
This code can be adjusted to our needs and easily deployed with Terraform commands.
Google Cloud also offers a GitHub repository for creating an environment that is fully configured with best practices. The GitHub repository is available at https://github.com/terraform-google-modules/terraform-example-foundation.
It consists of many stages and is highly adjustable to our needs. Try various Google Cloud Terraform templates to build secure, enterprise-ready Google Cloud environments and resources.
The following section will focus on browsing and deploying Google Cloud Marketplace solutions.
Google Cloud Marketplace is a catalog of third-party software that is integrated with Google Cloud Platform and ready to deploy in just a few clicks. The Google Cloud ecosystem is broad and consists of many products. However, some of them might not be available as native solutions. For example, let’s say you have been using GitLab in the past and would like to use it in Google Cloud. Google Cloud offers its products with Git functionality, but you need to use certain features from GitLab and don’t want to deploy it yourself.
In that case, Google Cloud Marketplace comes to the rescue:
Figure 7.40 – Google Cloud Marketplace
The preceding screenshot shows that there are various options to choose from. In the search field, you can type in the product or solution you want to use, and within a few clicks, it will be up and running.