Instale o Terraform

Esta página descreve os passos para instalar o Terraform Google Cloud no Cloud Shell e numa shell local. A Cloud Shell é um ambiente de shell interativo para Google Cloud que lhe permite aprender e experimentar Google Cloud e gerir os seus projetos e recursos a partir do navegador de Internet.

Para um guia introdutório à utilização do Terraform com o Google Cloud, consulte o Início rápido do Terraform para o Google Cloud .

Cloud Shell

  1. Para usar um terminal online com a CLI gcloud e o Terraform já configurados, ative o Cloud Shell:

    Na parte inferior desta página, é iniciada uma sessão do Cloud Shell e é apresentado um comando. A sessão pode demorar alguns segundos a ser inicializada.

  2. Execute o seguinte comando para verificar se o Terraform está disponível:

    terraform
    

    O resultado deve ser semelhante ao seguinte:

    
    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 o Terraform com o Google Cloud, deve garantir que as seguintes tarefas são concluídas no Google Cloud:

Shell local

  1. Use as instruções de instalação fornecidas pelo Terraform.

  2. Execute o seguinte comando para verificar se o Terraform está disponível:

    terraform
    

    O resultado deve ser semelhante ao seguinte:

    
     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 o Terraform com o Google Cloud, deve garantir que as seguintes tarefas são concluídas no Google Cloud:

O que se segue?