Executing Terraform in GCP Cloud Shell
In the two previous recipes, we learned about the usage of Terraform configuration to provision GCP resources and deploy those resources from a local machine (or virtual machine).
Like in Azure, the GCP console contains a cloud shell that provides the possibility to run GCP commands and tools inside the browser.
In this recipe, we will learn how to run Terraform inside GCP Cloud Shell to provision GCP resources and use the GCP console-connected account to automatically authenticate the provider.
Let’s get started!
Getting ready
To complete this recipe, you don’t need to install any software: all software used is included in GCP Cloud Shell.
The only requirement is to have an active GCP account, which we can get for free here: https://console.cloud.google.com/freetrial/.
The goal of this recipe is to write a Terraform configuration and run it inside GCP Cloud Shell.
How to do it…
To run...