Install Terraform
Stay organized with collections
Save and categorize content based on your preferences.
This page describes the steps to install Terraform for Google Cloud in Cloud Shell and in a local shell. Cloud Shell is an interactive shell environment for Google Cloud that lets you learn and experiment with Google Cloud and manage your projects and resources from your web browser.
For a introductory guide to using Terraform with Google Cloud, see the Terraform for Google Cloud Quickstart.
Cloud Shell
To use an online terminal with the gcloud CLI and Terraform already set up, activate Cloud Shell:
At the bottom of this page, a Cloud Shell session starts and displays a command-line prompt. It can take a few seconds for the session to initialize.
Run the following command to verify that Terraform is available:
terraformThe output should be similar to the following:
Usage:terraform[global options]<subcommand>[args] Theavailablecommandsforexecutionarelistedbelow. Theprimaryworkflowcommandsaregivenfirst,followedby lesscommonormoreadvancedcommands. Maincommands: initPrepareyourworkingdirectoryforothercommands validateCheckwhethertheconfigurationisvalid planShowchangesrequiredbythecurrentconfiguration applyCreateorupdateinfrastructure destroyDestroypreviously-createdinfrastructureTo use Terraform with Google Cloud, you should ensure the following tasks are completed within Google Cloud:
- Create or have a Google Cloud project.
- Enable billing for the Google Cloud project.
- Enable APIs for the Google Cloud services you intend to work with.
- Set up authentication for Terraform.
Local shell
Use the installation instructions provided by Terraform.
Run the following command to verify that Terraform is available:
terraformThe output should be similar to the following:
Usage:terraform[globaloptions]<subcommand>[args] Theavailablecommandsforexecutionarelistedbelow. Theprimaryworkflowcommandsaregivenfirst,followedby lesscommonormoreadvancedcommands. Maincommands: initPrepareyourworkingdirectoryforothercommands validateCheckwhethertheconfigurationisvalid planShowchangesrequiredbythecurrentconfiguration applyCreateorupdateinfrastructure destroyDestroypreviously-createdinfrastructureTo use Terraform with Google Cloud, you should ensure the following tasks are completed within Google Cloud:
- Create or have a Google Cloud project.
- Enable billing for the Google Cloud project.
- Enable APIs for the Google Cloud services you intend to work with.
- Set up authentication for Terraform.
What's next
- Work through the Terraform for Google Cloud quickstart
- Learn about the basic Terraform commands.