Skip to main content
Welcome to the Terraform Foundations section. Now that you’ve reviewed the HashiCorp Certified: Terraform Associate 004 exam objectives and installed Terraform and Visual Studio Code on your local machine, it’s time to begin the hands-on material. This lesson covers the core fundamentals of Terraform: what it is, why organizations adopt it, and how it improves infrastructure workflows compared with manually clicking through provider consoles or running ad-hoc CLI commands. You will learn the foundational concepts that explain how Terraform works and why it’s widely used for reproducible, automated infrastructure.
This section focuses on the essential Terraform concepts you need early in your study path. If you’re preparing for the HashiCorp Certified: Terraform Associate exam, these topics map closely to the exam’s foundational objectives.

What is Terraform?

Terraform is an open-source Infrastructure as Code (IaC) tool by HashiCorp that lets you define cloud and on-prem resources declaratively using configuration files (typically with the .tf extension). Terraform transforms those declarative files into an execution plan and then applies that plan to create, update, or destroy resources across multiple providers (AWS, Azure, GCP, and many others). Key verbs you’ll use frequently:
  • terraform init — initialize a working directory
  • terraform plan — preview changes before applying
  • terraform apply — execute the planned changes
  • terraform destroy — remove managed infrastructure

Why organizations use Terraform

Terraform introduces consistent, reproducible, and auditable infrastructure automation. Instead of manual clicks or scattered CLI scripts, Terraform gives you:
  • Declarative configuration: describe desired state, not imperative steps.
  • Multi-cloud and provider support: one tool for many platforms.
  • Versionable configurations: treat infrastructure like code in git.
  • Predictable change plans: preview changes with terraform plan.
  • Reusable modules: encapsulate and share architecture patterns.

Core Terraform concepts

ConceptPurposeExample/Notes
ConfigurationDeclare resources and settingsFiles with .tf using HCL (HashiCorp Configuration Language)
ProviderPlugin for a target platformprovider "aws" { region = "us-east-1" }
ResourceA managed infrastructure objectresource "aws_instance" "web" { ... }
StateMaps config to real resourcesStored locally or remotely (S3, Terraform Cloud)
Plan/ApplyPreview and enact changesterraform planterraform apply
ModuleReusable configuration unitLocal or registry-based modules for reuse
Terraform state contains the authoritative mapping of resources. Protect and manage state carefully (use remote backends and locking for teams) to avoid resource drift and corruption.

How Terraform improves workflows

  • Automation and CI/CD: Integrate Terraform into pipelines to provision and update infrastructure automatically.
  • Collaboration: Use remote state backends and workspaces to coordinate changes among teams.
  • Drift detection: terraform plan surfaces differences between configuration and real infrastructure.
  • Idempotence: Reapplying the same configuration converges the environment to the declared state.

Common usage pattern

  1. Write configuration (*.tf files).
  2. Initialize the working directory:
    • terraform init
  3. Validate and preview changes:
    • terraform validate
    • terraform plan
  4. Apply changes:
    • terraform apply
  5. Maintain and update through version control and CI.

Next steps and references

Suggested next hands-on exercises:
  • Create a simple provider configuration and one resource.
  • Initialize with terraform init, plan with terraform plan, and apply with terraform apply.
  • Configure a remote backend (e.g., S3 with DynamoDB locking for AWS) to experiment with team workflows.
This section prepares you for deeper topics such as modules, state backends, remote operations, and workspace strategies that follow in the next lessons.

Watch Video