Instalar Terraform

En esta página se describen los pasos para instalar Terraform en Cloud Shell y en un shell local.Google Cloud Cloud Shell es un entorno de shell interactivo para Google Cloud que te permite aprender y experimentar con Google Cloud y gestionar tus proyectos y recursos desde el navegador web.

Para consultar una guía introductoria sobre el uso de Terraform con Google Cloud, consulta la guía de inicio rápido de Terraform para Google Cloud .

Cloud Shell

  1. Para usar un terminal online con la CLI de gcloud 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 un mensaje de la línea de comandos. La sesión puede tardar unos segundos en inicializarse.

  2. Ejecuta el siguiente comando para verificar que Terraform está disponible:

    terraform
    

    La salida debería ser similar a la siguiente:

    
    Usage: terraform [global options] <subcommand> [args]
    
    The available commands for execution are listed below.
    The primary workflow commands are given first, followed by
    less common or more advanced commands.
    
    Main commands:
      init          Prepare your working directory for other commands
      validate      Check whether the configuration is valid
      plan          Show changes required by the current configuration
      apply         Create or update infrastructure
      destroy       Destroy previously-created infrastructure
    
    
  3. Para usar Terraform con Google Cloud, debes asegurarte de que se completen las siguientes tareas en Google Cloud:

Shell local

  1. Sigue las instrucciones de instalación proporcionadas por Terraform.

  2. Ejecuta el siguiente comando para verificar que Terraform está disponible:

    terraform
    

    La salida debería ser similar a la siguiente:

    
     Usage: terraform [global options] <subcommand> [args]
    
    The available commands for execution are listed below.
    The primary workflow commands are given first, followed by
    less common or more advanced commands.
    
    Main commands:
      init          Prepare your working directory for other commands
      validate      Check whether the configuration is valid
      plan          Show changes required by the current configuration
      apply         Create or update infrastructure
      destroy       Destroy previously-created infrastructure
    
  3. Para usar Terraform con Google Cloud, debes asegurarte de que se completen las siguientes tareas en Google Cloud:

Siguientes pasos