0
respostas

Error: Required token could not be found

Estou usando Ubuntu no Windows 10 (WSL), quando executo o terraform init da a mensagem abaixo.

Ja coloquei o aquivo como .rc e na pasta %APPDATA%/terraform.d/ e %APPDATA%/ Não funcionou.

root@LAPTOP-L2H365L7:/mnt/c/Users/jrdsi/OneDrive/Imagens/Documentos/Terraform/Linux# ./terraform init

Initializing the backend...
╷
│ Warning: Quoted references are deprecated
│
│   on instance.tf line 20, in resource "aws_instance" "dev4":
│   20:   depends_on = ["aws_s3_bucket.dev4"]
│
│ In this context, references are expected literally rather than in quotes. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will
│ be removed in a future version of Terraform. Remove the quotes surrounding this reference to silence this warning.
│
│ (and 5 more similar warnings elsewhere)
╵

╷
│ Warning: Version constraints inside provider configuration blocks are deprecated
│
│   on main.tf line 2, in provider "aws":
│    2:   version = "~> 2.0"
│
│ Terraform 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future
│ version of Terraform. To silence this warning, move the provider version constraint into the required_providers block.
│
│ (and one more similar warning elsewhere)
╵

╷
│ Error: Required token could not be found
│
│ Run the following command to generate a token for app.terraform.io:
│     terraform login
╵

root@LAPTOP-L2H365L7:/mnt/c/Users/jrdsi/OneDrive/Imagens/Documentos/Terraform/Linux#

Arquivo remote-state.tf

terraform {
    backend "remote" {
      hostname = "app.terraform.io"
      organization = "zero-alura"

      workspaces {
          name = "aws-zero-alura"
      }
    }

}

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software