> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use the Labs

> Guide to using Mastering Terraform Cloud hands on labs, including lab environment, web VS Code editor, integrated terminal, keyboard shortcuts, Terraform commands, and completing tasks

One of the key benefits of the [Mastering Terraform Cloud course](https://learn.kodekloud.com/user/courses/hashicorp-terraform-cloud) is the included hands‑on labs that give you real experience with Terraform Cloud workflows. This guide walks through the most effective way to use those labs so you can focus on learning instead of configuring tools.

## What the lab environment provides

When a lab is running, the UI typically presents:

| Pane | Purpose |
| - | - |
| Left | Lab instructions, step-by-step tasks, and solution buttons |
| Right | Web-based Visual Studio Code preview (edit files, open folders, run commands) |
| Integrated terminal | Execute commands in the workspace and run Terraform, Git, and other tools |

Use the navigation arrows in the instructions pane to skip forward or back. Most labs also include quick links (for example, a shortcut to the Terraform Cloud workspace), so use those to open referenced resources quickly.

Note: Labs are pre-configured with the tools you need (Terraform, Git, Sentinel, etc.). For this course we will be using the Terraform workspace `devops-aws-myapp-dev`, which should already exist in the lab environment. Follow the lab instructions to access or verify that workspace before proceeding.

You can resize the panes or open the VS Code preview in a new window if you prefer to place instructions on one monitor and the editor/terminal on another.

![A browser window open to a KodeKloud lab titled "Lab: Terraform Cloud Workspace – Remote Execution." The left side shows copy/paste and terminal shortcut instructions while the right side displays a Visual Studio Code preview of a Terraform Cloud README.](https://mintcdn.com/kodekloud-c4ac6d9a/UK3oaG81L_yXeDcP/images/Lab-HashiCorp-Terraform-Cloud/Terraform-Cloud-Workspaces/How-to-use-the-Labs/terraform-cloud-remote-execution-lab.jpg?fit=max\&auto=format\&n=UK3oaG81L_yXeDcP\&q=85\&s=42ef708d294054f0295d84e84f24a179)

## Keyboard shortcuts

Use these common shortcuts inside the lab (works for the integrated terminal and editor):

| Action | macOS | Windows |
| - | - | - |
| Toggle the integrated terminal | `Control + `` \| `Control + \` | |
| Copy selection to clipboard | `Command + C` | `Ctrl + C` |
| Paste into terminal | `Command + V` | `Ctrl + V` (or `Shift + Insert`) |

Tip: Right-click a folder or file and choose **Open in Integrated Terminal** to start the terminal with that folder as the working directory.

## Working in the editor

* Most labs include example code already populated in the repository. Click files/folders to open them with syntax highlighting.
* Use the integrated terminal to run Terraform commands from within the repo—no local installation required.
* To execute commands in a particular folder, open that folder in the integrated terminal (right‑click → Open in Integrated Terminal).

### Example Terraform provider configuration

A common example you’ll find in lab repos is the AWS provider configuration:

```hcl theme={null}
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

provider "aws" {
  region = var.region
  default_tags {
    tags = {
      Owner       = var.owner
      Project     = var.project
      Environment = var.environment
    }
  }
}
```

## Integrated environment and available binaries

The lab environment already includes essential binaries such as Terraform, Git, and Sentinel. You can verify availability by running `terraform` (or `terraform version`) in the integrated terminal. Example Terraform usage output you may see:

```text theme={null}
bob@iac-server ~/clumsy_bird via ✨ default ✖ terraform
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
    init        Prepare your working directory for other commands
    validate    Check whether the configuration is valid
    plan        Show changes required by the current configuration
    apply       Create or update infrastructure
    destroy     Destroy previously-created infrastructure

All other commands:
    console         Try Terraform expressions at an interactive command prompt
    fmt             Reformat your configuration in the standard style
    force-unlock    Release a stuck lock on the current workspace
    get             Install or upgrade remote Terraform modules
    graph           Generate a Graphviz graph of the steps in an operation
    import          Associate existing infrastructure with a Terraform resource
    login           Obtain and save credentials for a remote host
    logout          Remove locally-stored credentials for a remote host
    output          Show output values from your root module
    providers       Show the providers required for this configuration
    refresh         Update the state to match remote systems
    show            Show the current state or a saved plan
    state           Advanced state management
    taint           Mark a resource instance as not fully functional
    test            Experimental support for module integration testing
    untaint         Remove the 'tainted' state from a resource instance
    version         Show the current Terraform version
    workspace       Workspace management

Global options (use these before the subcommand, if any):
    -chdir=DIR  Switch to a different working directory before executing the
                given subcommand.
    -help       Show this help output, or the help for a specified subcommand.
    -version    An alias for the "version" subcommand.
```

Example shell prompt you may see while working in the repo:

```text theme={null}
bob@iac-server ~/clumsy_bird via ◆ default *
```

## Solutions and completing the lab

* Each task usually has a "Solution" view. Attempt the task first, then compare your approach with the solution to learn best practices and alternative techniques.
* When you complete a task, click the lab’s confirmation button (for example, OK or Complete Task) to progress.
* After all tasks are finished you’ll see a congratulations screen with options to end the lab session and submit feedback.

## Summary

Using the course labs is the best way to practice Terraform Cloud workflows safely and efficiently. The environment is preconfigured with the required tools, the web-based VS Code and integrated terminal let you run commands without installing anything locally, and built-in solutions help accelerate learning. Step through the tasks, try different approaches, and review the solutions to deepen your Terraform Cloud skills.

## Links and references

* [Terraform documentation](https://www.terraform.io/docs)
* [Terraform CLI commands](https://www.terraform.io/cli)
* [Visual Studio Code — Web editor info](https://code.visualstudio.com/docs/remote/browser)

> **[Watch Video](https://learn.kodekloud.com/user/courses/lab-hashicorp-terraform-cloud/module/4b043164-0ba6-4315-bdfe-9596102630e1/lesson/5e11326b-1c53-42c8-83d0-66a6aad5fdb5)**

> **[Practice Lab](https://learn.kodekloud.com/user/courses/lab-hashicorp-terraform-cloud/module/4b043164-0ba6-4315-bdfe-9596102630e1/lesson/a3ac255f-5847-4bee-9737-9cfb17072145)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.