Nesta página, descrevemos as etapas para instalar o Terraform para Google Cloud no Cloud Shell e em um shell local. O Cloud Shell é um ambiente shell interativo para Google Cloud que permite aprender e testar o Google Cloud e gerenciar seus projetos e recursos do navegador da Web.
Para um guia introdutório sobre como usar o Terraform com o Google Cloud, consulte o Guia de início rápido do Terraform para Google Cloud .
Cloud Shell
Para usar um terminal on-line com a gcloud CLI e o Terraform já configurados, ative o Cloud Shell:
Na parte de baixo desta página, uma sessão do Cloud Shell é iniciada e exibe um prompt de linha de comando. A inicialização da sessão pode levar alguns segundos.
Execute o seguinte comando para verificar se o Terraform está disponível:
terraformA saída será semelhante a esta:
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 infrastructurePara usar o Terraform com o Google Cloud, verifique se as seguintes tarefas foram concluídas no Google Cloud:
- Crie ou tenha um Google Cloud projeto.
- Ative o faturamento do projeto Google Cloud .
- Ative as APIs para os Google Cloud serviços com que você pretende trabalhar.
- Configure a autenticação para o Terraform.
Shell local
Siga as instruções de instalação fornecidas pelo Terraform.
Execute o seguinte comando para verificar se o Terraform está disponível:
terraformA saída será semelhante a esta:
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 infrastructurePara usar o Terraform com o Google Cloud, verifique se as seguintes tarefas foram concluídas no Google Cloud:
- Crie ou tenha um Google Cloud projeto.
- Ative o faturamento do projeto Google Cloud .
- Ative as APIs para os Google Cloud serviços com que você pretende trabalhar.
- Configure a autenticação para o Terraform.
A seguir
- Trabalhe no Guia de início rápido do Terraform para Google Cloud
- Saiba mais sobre os comandos básicos do Terraform.