HashiCorp : Terraform Cloud
Terraform Cloud Setup
Lab Solution Sign Up Setup
Welcome to this hands-on lab. In this guide, you’ll sign up for Terraform Cloud, create your first organization, and integrate the Terraform CLI with Terraform Cloud. By the end, you’ll be ready to manage infrastructure seamlessly across any cloud.
Table of Contents
- Task 1: Sign Up for Terraform Cloud
- Task 2: Create a Terraform Cloud Organization
- Task 3: Authenticate via the CLI
- Summary of Tasks
- Links and References
Task 1: Sign Up for Terraform Cloud
Begin by navigating to the Terraform website:
- Go to terraform.io and click Try Terraform Cloud.
- On the signup form, enter your desired Username, Email, and Password, then submit.
Note
If you already have an account, click Sign In instead of creating a new one.
Task 2: Create a Terraform Cloud Organization
Once you’re logged in, Terraform Cloud prompts you to create a new organization if none exists. Organization names must be unique across all Terraform Cloud users.
- Enter a globally unique Organization Name.
- Confirm your email address.
- Click Create organization.
In this lab, our example org is named Mastering Terraform Cloud. You’ll see the new organization dashboard, ready for workspace and settings configuration.
Task 3: Authenticate via the CLI
To link your local Terraform CLI to Terraform Cloud, generate an API token:
- Run the login command in your terminal:
terraform login
- When prompted, confirm by typing
yes
:Do you want to proceed? Only 'yes' will be accepted to confirm. Enter a value: yes
- Terraform opens a browser window to the tokens page:
Open the following URL to access the tokens page for app.terraform.io: https://app.terraform.io/app/settings/tokens?source=terraform-login
- On the Terraform Cloud website, create a new token (e.g., Terraform login – Mastering Terraform Cloud) and copy it.
- Paste the token back into the CLI (it will be hidden as you type):
Token for app.terraform.io: Enter a value: <paste-your-token>
Upon successful authentication, you’ll see a confirmation message:
Retrieved token for user <your_username>
Welcome to Terraform Cloud!
Documentation: terraform.io/docs/cloud
New to TFC? Follow these steps to instantly apply an example configuration:
$ git clone https://github.com/hashicorp/tfc-getting-started.git
$ cd tfc-getting-started
$ scripts/setup.sh
Warning
Your API token is stored in plain text at ~/.terraform.d/credentials.tfrc.json
. To remove it, run:
terraform logout
Summary of Tasks
Task | Description |
---|---|
1. Sign Up for Terraform Cloud | Create your free Terraform Cloud account |
2. Create a Terraform Cloud Org | Choose a unique name and confirm your email |
3. Authenticate via the CLI | Generate and store an API token for app.terraform.io |
Links and References
Watch Video
Watch video content