• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Tutorials

Skip to main contentOverview

Get Started

  • AWS
  • Azure
  • Docker
  • GCP
  • OCI
  • Terraform Cloud

Fundamentals

  • CLI
  • Configuration Language
  • Modules
  • Provision
  • State
  • Terraform Cloud

Use Cases

  • Applications
  • AWS Services
  • Azure Services
  • HashiCorp Products
  • IT/SaaS Providers
  • Kubernetes
  • Machine Images
  • Networking
  • Policy
  • Security

Certification Prep

  • Associate Prep (002)
  • Associate Prep (003)
  • Associate Tutorials (002)
  • Associate Tutorials (003)

Production

  • Automate Terraform
  • Enterprise Patterns
  • Terraform Enterprise

Integrations

  • CDK for Terraform
  • Community Providers
  • Custom Framework Providers
  • Custom SDK Providers
  • Secrets

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Tutorials
  4. GCP

Get Started - Google Cloud

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.

Start
7 tutorials
  1.  
    3min
    What is Infrastructure as Code with Terraform?
    Learn how infrastructure as code lets you safely build, change, and manage infrastructure. Try Terraform.
    • Terraform
    • Interactive
    • Video
  2.  
    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.
    • Terraform
    • Interactive
    • Video
  3.  
    10min
    Build Infrastructure - Terraform GCP Example
    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.
    • Terraform
  4.  
    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.
    • Terraform
  5.  
    3min
    Destroy Infrastructure
    Destroy Google Cloud infrastructure managed by Terraform. Evaluate the plan and confirm the destruction.
    • Terraform
  6.  
    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.
    • Terraform
  7.  
    4min
    Query Data with Output Variables
    Output the public IP of your Google Cloud instance using output variables. Read about using outputs to query specific data from Terraform state.
    • Terraform
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)