Skip to main content
Welcome — this guide walks you through downloading, installing, and getting started with Microsoft Visual Studio Code on your local machine. It also covers opening a workspace, useful extensions for Terraform development, and using the integrated terminal and source control features. Download and install
  • Visit the official download page: https://code.visualstudio.com/download and select the installer for your operating system (Windows, macOS, or Linux).
  • Choose the correct build for your machine (for example, Apple Silicon vs Intel on macOS), download the installer, and run it.
Choose the installer that matches both your OS and CPU architecture (Intel vs Apple Silicon on macOS) to avoid runtime issues or performance penalties.
The image shows a webpage for downloading Visual Studio Code for different operating systems: Windows, Linux, and macOS, with specific download options for each system.
Opening a folder / workspace
  • After installation, launch VS Code.
  • Open your project folder using File > Open Folder (or use the Explorer icon in the Activity Bar). You can add multiple folders to a single workspace if you need to work across repositories or projects.
  • The Explorer will display the files and folders in the workspace and allow you to right‑click to open an integrated terminal at any folder path.
The image shows the Visual Studio Code interface with no folder opened, offering options to open a folder or clone a repository. It also displays shortcut keys for various commands.
Example project files
  • Once a folder is opened, VS Code lists files in the Explorer. Below is a common Terraform main.tf example you might find in a demo project. It demonstrates VPC and subnet resources and how tags are used.
resource "aws_vpc" "production" {
  cidr_block = "10.0.0.0/16"

  tags = {
    Name = "production"
  }
}

resource "aws_vpc" "dev" {
  cidr_block = "10.10.0.0/16"

  tags = {
    Name = "dev"
  }
}

resource "aws_subnet" "workloads" {
  vpc_id     = aws_vpc.production.id
  cidr_block = "10.0.1.0/24"

  tags = {
    Name = "workloads"
  }
}
Provider configuration
  • Your project will typically declare required providers. Here is an example terraform block that pins the AWS provider:
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.62.0"
    }
  }
}
Explorer, Search, and Source Control
  • Use the Explorer to browse files and the magnifying glass (Search) to find text across all workspace files.
  • Use Outline or Go to Symbol (Ctrl/Cmd+Shift+O) to jump to functions and resource blocks quickly.
  • The Source Control view provides an integrated Git experience: stage changes, commit, create branches, and push/pull to remote repositories directly from VS Code when the folder is a Git repo.
Extensions — recommended for Terraform workflows
  • Click the Extensions icon to browse and install extensions from the Marketplace. Extensions enhance syntax highlighting, formatting, linting, container tooling, and AI-assisted coding.
  • Popular extensions for Terraform and cloud development:
ExtensionPurposeMarketplace / Notes
CodeSnapCapture attractive screenshots of code snippetsUseful for documentation and presentations.
DockerBuild, run, and debug containerized appsIntegrates with Docker Engine and Docker Compose.
GitHub CopilotAI-assisted code suggestionsInstallable from the Extensions view; requires GitHub account/subscription.
HashiCorp Terraform / HCLSyntax highlighting, formatting, linting for TerraformImproves HCL editing and integrates with language server features.
Python / KubernetesLanguage support and cluster toolsInstall based on your stack (e.g., Python for scripts, Kubernetes for manifests).
  • As you add extensions, new Activity Bar icons or commands may appear (e.g., Terraform actions, Remote Explorer for dev containers, or Terraform Cloud integrations).
Integrated terminal
  • VS Code includes an integrated terminal scoped to your workspace. To open a terminal at a specific folder, right-click that folder in Explorer and choose “Open in Integrated Terminal”, or use the Terminal menu.
  • The terminal runs your default shell (zsh, bash, PowerShell), supports multiple terminals, and persists your working directory so CLI tools (Terraform, git, npm, etc.) run in the workspace context.
The image shows a terminal interface in a coding environment, with a dropdown displaying details about the shell process (zsh), its process ID, command line, and shell integration status.
Example: checking the current directory in the integrated terminal
bk~$ pwd
/Users/bk/Terraform/demo
bk~$
This confirms the integrated terminal is running in the same folder opened by Explorer, so Terraform commands and version control operations affect the correct project directory. Tips and troubleshooting
If an extension or language feature doesn’t behave as expected, try reloading the window (Cmd/Ctrl+Shift+P → “Developer: Reload Window”) or reinstalling the extension. For Terraform-specific issues, ensure your Terraform binary is installed and on your PATH.
Next steps and references
  • Install the full set of extensions you need for the course (including GitHub Copilot if available for your account).
  • Confirm Terraform is installed locally and accessible from the integrated terminal.
  • Continue to the next lesson where we’ll use VS Code and the integrated terminal to run Terraform commands and explore state and plans.
Useful links and references Happy coding — get VS Code installed, configure the extensions you need, and proceed to the next lesson.

Watch Video