• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Terraform CLI

Skip to main content
  • Terraform CLI
  • Basic CLI Features
    • Overview
    • login
    • logout

  • Terraform Internals

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Terraform CLI
  4. Authenticating
  • Terraform
  • v1.2.x
  • v1.1 and earlier

»CLI Authentication

Hands-on: Try the Authenticate the CLI with Terraform Cloud tutorial.

Terraform Cloud 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 "Terraform Cloud.")

Terraform CLI integrates with Terraform Cloud in several ways — it can be a front-end for CLI-driven runs in Terraform Cloud, and can also use Terraform Cloud as a state backend and a private module registry. All of these integrations require you to authenticate Terraform CLI with your Terraform Cloud 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 Terraform Cloud user account.

For details, see:

  • The terraform login command
  • The terraform logout command
Edit this page on GitHub
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)