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
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.
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
Para usar Terraform con Google Cloud, debes asegurarte de que se completen las siguientes tareas en Google Cloud:
- Crea o ten un Google Cloud proyecto.
- Habilita la facturación del Google Cloud proyecto.
- Habilita las APIs de los Google Cloud servicios con los que quieras trabajar.
- Configura la autenticación para Terraform.
Shell local
Sigue las instrucciones de instalación proporcionadas por Terraform.
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
Para usar Terraform con Google Cloud, debes asegurarte de que se completen las siguientes tareas en Google Cloud:
- Crea o ten un Google Cloud proyecto.
- Habilita la facturación del Google Cloud proyecto.
- Habilita las APIs de los Google Cloud servicios con los que quieras trabajar.
- Configura la autenticación para Terraform.
Siguientes pasos
- Sigue la guía de inicio rápido de Terraform Google Cloud .
- Consulta los comandos básicos de Terraform.