You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/website/docs/cli/auth/index.mdx

32 lines
1.4 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
page_title: Authentication - Terraform CLI
description: >-
Documentation about the login and logout commands that help automate getting
an API token for your HCP Terraform account.
---
# CLI Authentication
> **Hands-on:** Try the [Authenticate the CLI with HCP Terraform](/terraform/tutorials/cloud/cloud-login?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial.
[HCP Terraform](https://cloud.hashicorp.com/products/terraform) and
[Terraform Enterprise](/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](/terraform/cloud-docs/run/cli) 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:
- [The `terraform login` command](/terraform/cli/commands/login)
- [The `terraform logout` command](/terraform/cli/commands/logout)