Terraform Infrastructure as Code

Learn Terraform Infrastructure As Code. This module covers Terraform Concepts and Setup, Defining Resources, Variables and Outputs, Handling State, Terraform Modules. You will master these essential Linux skills through hands-on labs and real-world challenges.

DevOps EngineerLinuxDevOps

Introduction

Terraform describes desired infrastructure in HCL, builds a dependency graph, and records which real resources belong to that configuration. This hands-on course teaches that lifecycle safely on a local machine using Docker containers and files rather than a paid cloud account.

You will initialize providers, preview and apply changes, parameterize a container, and inspect an output. You will also delete a managed container outside Terraform to observe drift detection and reconciliation, then package local_file resources behind reusable module inputs.

What You Will Learn

  • Install Terraform and initialize a working directory with a pinned provider
  • Define Docker image and container resources and reference one resource from another
  • Read a Terraform plan before applying infrastructure changes
  • Apply a configuration and verify the resulting Nginx container and port mapping
  • Declare typed variables, override a value, and expose a resource output
  • Inspect local state and explain why it must not be edited manually
  • Create drift, detect it during refresh, and reconcile the missing resource
  • Build, call, and reuse local modules with required and default inputs

Who This Course Is For

This intermediate course is for Linux users, system administrators, and DevOps learners who want a practical introduction to Terraform’s configuration, planning, state, and module model.

Prerequisites: Comfort with Linux shell commands, sudo, text editing, Docker images and containers, ports, and basic structured configuration. No cloud account or previous HCL experience is required.

Learning environment: A Linux terminal with Terraform, Docker, internet access for provider downloads, and local state files. Docker and local_file providers keep every resource on the lab machine.

Frequently Asked Questions

Will I provision resources in AWS, Azure, or Google Cloud?

No. The course uses a local Docker provider for an Nginx container and the local provider for text files. It teaches Terraform workflow concepts without cloud credentials, networks, virtual machines, or billing.

Does the state lab cover remote backends and team locking?

No. You inspect a local terraform.tfstate, delete a Docker container manually, run plan to detect drift, and use apply to recreate it. Remote state, locking, migration, import, and sensitive-state protection are outside the scope.

Do the “webserver” modules create actual servers?

No. They create local configuration text files from server_name and env inputs. The final challenge likewise builds a reusable module that writes challenge_result.txt, focusing on module structure rather than cloud provisioning.

Teacher

labby
Labby
Labby is the LabEx teacher.