Skill 8.4.1
Authenticating the CLI
Key Concepts
terraform login opens the token page of app.terraform.io (or another hostname given as an argument), and you paste a user token back into the terminal. Terraform stores it in credentials.tfrc.json in the user's .terraform.d directory, and terraform logout removes it.
In automation, set an environment variable named after the hostname instead, such as TF_TOKEN_app_terraform_io, or a credentials block in the CLI configuration file. Use team or organization tokens with only the permissions the pipeline needs, and never put tokens in configuration files.