terraform login
The command that obtains an HCP Terraform API token and saves it in the CLI credentials file.
In more detail
It opens a browser to create a token for app.terraform.io, or for another hostname you name, and stores it in your home directory. Without a token, terraform init on a configuration with a cloud block stops and suggests running it. Pipelines usually supply a team token through an environment variable instead.
Examples
terraform loginterraform login tfe.example.comRelated terms
- cloud block — The block inside the terraform block that connects a configuration to HCP Terraform or Terraform Enterprise.
- HCP Terraform — HashiCorp's hosted service for running Terraform, which keeps state, runs plans and applies on its own machines, and controls who may change what.
Taught in
- The Local Backend, And Workspaces On One Machine — HashiCorp Terraform Associate (004) Exam Prep
- Runs In HCP Terraform: The cloud Block And Remote Execution — HashiCorp Terraform Associate (004) Exam Prep
- VCS, CLI And API Workflows: Speculative Plans And Run Triggers — HashiCorp Terraform Associate (004) Exam Prep