Terraform for Beginners

In this course, learn the fundamentals of Infrastructure as Code using Terraform. Explore installation, project setup, resource creation, variables, outputs, modules, state management, and resource destruction.

DevOps

Introduction

Learn Terraform’s core Infrastructure as Code workflow through eight guided, terminal-based labs. Starting with installation on Ubuntu, you will write HCL configuration, initialize providers, preview and apply changes, parameterize resources, expose outputs, organize a local module, inspect state, and perform a controlled teardown.

The course deliberately uses the hashicorp/local provider to manage files inside the lab. This keeps the focus on Terraform concepts and command behavior without introducing a cloud platform, credentials, or billable infrastructure.

What You Will Learn

After completing this course, you will be able to:

  • Install Terraform from HashiCorp’s official Ubuntu package repository and verify the repository signing key.
  • Declare a required provider in HCL, initialize a project with terraform init, and inspect downloaded provider files.
  • Define a local_file resource, preview its change with terraform plan, apply it, and verify the resulting file.
  • Declare typed input variables and supply values to make resource configuration flexible and reusable.
  • Define outputs from resource attributes and retrieve their values with terraform output.
  • Build and call a local child module with inputs and outputs, then use it from a root configuration.
  • Inspect local state with terraform show, terraform state list, and the state file, then move a resource address and refresh state.
  • Preview deletion with terraform plan -destroy, run terraform destroy, and confirm that both the resource and state reflect the teardown.

Who This Course Is For

This course is for Terraform newcomers, junior DevOps learners, and developers who want to understand the mechanics of a declarative Infrastructure as Code workflow before working with a cloud provider. It emphasizes the relationship between configuration, provider plugins, plans, managed resources, outputs, modules, and state.

Prerequisites: No previous Terraform experience is required. You should be comfortable navigating an Ubuntu terminal, creating and editing text files, and reading command output; basic familiarity with configuration files and command-line package installation is helpful.

Learning environment: All eight labs run in provided Ubuntu 22.04 terminal environments. You install Terraform in the first lab, while the remaining exercises use local project directories and the hashicorp/local provider; no browser-based cloud console is involved.

Frequently Asked Questions

Will I provision AWS, Azure, Google Cloud, or other real cloud resources?

No. Every managed resource in the course is a local file created with hashicorp/local. You will learn the Terraform workflow that cloud providers also use, but you will not configure cloud credentials, create a cloud account, or incur infrastructure charges.

How advanced is the state-management coverage?

The state lab introduces local state inspection, listing managed addresses, moving a resource address, and refreshing state. Remote backends, state locking, workspaces, importing existing infrastructure, and team workflows are not included.

Does the module lab use the public Terraform Registry?

No. You create a child module in a local modules directory, define its variables and outputs, and call it from the root configuration. Publishing, versioning, and consuming registry modules are beyond the course scope.

Do I need to install Terraform on my own computer before enrolling?

No. The installation exercise takes place in the supplied Ubuntu lab, and later labs provide the environment needed for their tasks. You do not need to modify your personal machine.

Teacher

labby
Labby
Labby is the LabEx teacher.