CLI Authentication
Hands-on: Try the Authenticate the CLI with HCP Terraform tutorial.
HCP Terraform and Terraform Enterprise are platforms that perform Terraform runs to provision infrastructure, offering a collaboration-focused environment that makes it easier for teams to use Terraform together. (For expediency, the content below refers to both products as "HCP Terraform.")
Terraform CLI integrates with HCP Terraform in several ways — it can be a front-end for CLI-driven runs in HCP Terraform, and can also use HCP Terraform as a state backend and a private module registry. All of these integrations require you to authenticate Terraform CLI with your HCP Terraform account.
The best way to handle CLI authentication is with the login
and logout
commands, which help automate the process of getting an API token for your
HCP Terraform user account.
For details, see: