Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se describen los pasos para instalar y configurar Terraform para
Google Cloud en Cloud Shell y en una shell local.
Cloud Shell es un entorno de shell interactivo para Google Cloud
que te permite aprender y experimentar con Google Cloud, además de administrar tus
proyectos y recursos desde tu navegador web.
Cloud Shell
Para usar una terminal en línea con gcloud CLI y Terraform
ya configurados, activa Cloud Shell.
En la parte inferior de esta página, se inicia una sesión de Cloud Shell y
se muestra una instrucción de línea de comandos. La sesión puede tardar unos segundos en inicializarse.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis guide details the process of installing and configuring Terraform for Google Cloud, both in the online Cloud Shell environment and in a local shell.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, you'll need to create or select a Google Cloud project and ensure that billing is enabled for it.\u003c/p\u003e\n"],["\u003cp\u003eProvisioning Google Cloud resources with Terraform requires enabling the relevant APIs and setting up specific Identity and Access Management roles for your user account.\u003c/p\u003e\n"],["\u003cp\u003eVerify that Terraform is correctly installed and operational by executing the \u003ccode\u003eterraform\u003c/code\u003e command in your terminal.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Shell environment comes pre-configured with Terraform and the gcloud CLI, while local shell users will have to install and initialize them.\u003c/p\u003e\n"]]],[],null,["# Install Terraform\n\nThis page describes the steps to install Terraform for\nGoogle Cloud in [Cloud Shell](/shell/docs) and in a local shell.\nCloud Shell is an interactive shell environment for Google Cloud\nthat lets you learn and experiment with Google Cloud and manage your\nprojects and resources from your web browser.\n\nFor a introductory guide to using Terraform with Google Cloud, see the\n[Terraform for Google Cloud Quickstart](/docs/terraform/create-vm-instance). \n\n### Cloud Shell\n\n\n1. To use an online terminal with the gcloud CLI and Terraform\n already set up, activate Cloud Shell:\n\n At the bottom of this page, a Cloud Shell session starts and\n displays a command-line prompt. It can take a few seconds for the session\n to initialize.\n2. Run the following command to verify that Terraform is available:\n\n terraform\n\n The output should be similar to the following: \n\n\n Usage: terraform [global options] \u003csubcommand\u003e [args]\n\n The available commands for execution are listed below.\n The primary workflow commands are given first, followed by\n less common or more advanced commands.\n\n Main commands:\n init Prepare your working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by the current configuration\n apply Create or update infrastructure\n destroy Destroy previously-created infrastructure\n\n3. To use Terraform with Google Cloud, you should ensure the\n following tasks are completed within Google Cloud:\n\n - [Create or have a Google Cloud project](/resource-manager/docs/creating-managing-projects).\n - [Enable billing](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.\n - [Enable APIs](/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.\n - [Set up authentication](/docs/terraform/authentication) for Terraform.\n\n### Local shell\n\n1. Use the [installation instructions](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/install-cli)\n provided by Terraform.\n\n2. Run the following command to verify that Terraform is available:\n\n terraform\n\n The output should be similar to the following: \n\n\n Usage: terraform [global options] \u003csubcommand\u003e [args]\n\n The available commands for execution are listed below.\n The primary workflow commands are given first, followed by\n less common or more advanced commands.\n\n Main commands:\n init Prepare your working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by the current configuration\n apply Create or update infrastructure\n destroy Destroy previously-created infrastructure\n\n3. To use Terraform with Google Cloud, you should ensure the\n following tasks are completed within Google Cloud:\n\n - [Create or have a Google Cloud project](/resource-manager/docs/creating-managing-projects).\n - [Enable billing](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.\n - [Enable APIs](/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.\n - [Set up authentication](/docs/terraform/authentication) for Terraform.\n\nWhat's next\n-----------\n\n- Work through the [Terraform for Google Cloud quickstart](/docs/terraform/create-vm-instance)\n- Learn about the [basic Terraform commands](/docs/terraform/basic-commands)."]]