How to do it...

After the successful installation of Terraform on your machine, we'll build the Terraform configuration setup step by step:

  1. Set up the environment variables and the Google Cloud provider block
  2. Create the two additional compute disks
  3. Create the VM with two additional disks

Let's look into these steps in detail:

  1. The code for this recipe can be found in the Chapter07/terraform file. The first part of configuring Terraform is setting up the Google Cloud provider, which is as follows. Save the configuration to a file, example.tf:
// Configure the Google Cloud providerprovider "google" {  project     = "<Project ID>"  region      = "us-central1"}
  1. To execute the configuration, the provider needs to possess proper credentials. Credentials ...

Get Google Cloud Platform Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.