Build, change, and destroy Google Cloud Platform (GCP) infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
Learn how infrastructure as code lets you safely build, change, and manage infrastructure. Try Terraform.
9min
Install Terraform
Install Terraform on Mac, Linux, or Windows by downloading the binary or using a package manager (Homebrew or Chocolatey). Then create a Docker container locally by following a quick-start tutorial to check that Terraform installed correctly.
10min
Build infrastructure
Authenticate to Google Cloud and create a VPC network. Write and validate Terraform configuration, initialize a configuration directory, and plan and apply a configuration to create infrastructure.
9min
Change infrastructure
Add a Google Compute Engine VM instance to a VPC by referencing the VPC in its configuration using arguments. Modify the instance by adding tags, and implement a destructive change.
3min
Destroy infrastructure
Destroy Google Cloud infrastructure managed by Terraform. Evaluate the plan and confirm the destruction.
3min
Define input variables
Declare your GCP credential location, infrastructure region and zone as variables. Reference these variables in Terraform configuration. Define them using command line flags, environment variables, .tfvars files or default values.
4min
Query data with output values
Output the public IP of your Google Cloud instance using output variables. Read about using outputs to query specific data from Terraform state.
We use cookies & other similar technology to collect data to improve your experience on our site, as described in our Privacy Policy and Cookie Policy.