Terraform in Depth

DevOps

Prerequisites 

● A foundational understanding of IT infrastructure

● Knowledge of Unix/Linux operating system

● Basic knowledge about Software Development Life Cycle

● Laptop (4 GB RAM, 4 core) with good internet (10Mbs +)

 

Learning outcomes 

● Learn Terraform in depth

● 70+ labs helping engineers to be productive on Terraform from Day 1


Duration: 5 Days (40 Hours)

Venue: Classroom Based/Virtual Instructor-Led Training

man in black crew neck t-shirt using black laptop computer

Course Outline


Terraform Training Outline (Updated)

Day 1 – Terraform Fundamentals

Terraform Installation, Settings and Provider Configuration

  • Step 01: Introduction to Infrastructure as Code and Terraform
  • Step 02: Installing Terraform and verifying installation
  • Step 03: Terraform CLI workflow – init, plan, apply, destroy
  • Step 04: Terraform settings block (terraform {}) overview
  • Step 05: Understanding required_version
  • Step 06: Terraform providers introduction
  • Step 07: Understanding required_providers
  • Step 08: Provider configuration block
  • Step 09: Running terraform apply and terraform destroy
  • Step 10: Using -auto-approve option

Working with Multiple Providers

  • Step 01: Introduction to multiple providers
  • Step 02: Provider aliases
  • Step 03: Implementing multiple providers
  • Step 04: Verifying resources and clean-up

Terraform Dependency Lock File

  • Step 01: Introduction to .terraform.lock.hcl
  • Step 02: Understanding provider version locking
  • Step 03: Create Resource Group and Random String resource
  • Step 04: Create Azure Storage Account resource
  • Step 05: Review lock file behavior and clean-up

Terraform Resource Syntax and Behavior

  • Step 01: Terraform resource block syntax
  • Step 02: Creating a Virtual Network resource
  • Step 03: Creating Subnet, Public IP and Network Interface
  • Step 04: Terraform resource lifecycle basics
  • Step 05: Resource creation demonstration
  • Step 06: Understanding Terraform state
  • Step 07: Resource update behavior
  • Update in place
  • Destroy and recreate
  • Step 08: Desired state vs current state
  • Step 09: Clean-up resources


Day 2 – Terraform Meta Arguments and VM Deployment

Terraform Meta-Arguments Overview

  • Step 01: Introduction to Terraform meta-arguments
  • Step 02: Understanding depends_on
  • Step 03: Execution without depends_on
  • Step 04: Execution with depends_on
  • Step 05: Understanding Terraform dependency graph

Provisioning Azure Linux VM with Terraform

  • Step 01: Introduction to Azure Linux VM provisioning
  • Step 02: Terraform configuration for Azure VM
  • Step 03: Cloud-init overview and custom_data
  • Step 04: Using filebase64() function
  • Step 05: Execute Terraform commands and verify resources
  • Step 06: Clean-up resources

Terraform Meta-Argument count

  • Step 01: Introduction to count
  • Step 02: Using count with Azure Resource Groups
  • Step 03: Deploying multiple Linux VMs with count
  • Step 04: Terraform functions: length(), element()
  • Step 05: Splat expressions ([*])
  • Step 06: Verification and clean-up

Terraform Meta-Argument for_each

  • Step 01: Introduction to for_each
  • Step 02: Using for_each with maps
  • Step 03: Using for_each with sets of strings
  • Step 04: Terraform console usage
  • Step 05: for_each chaining between resources
  • Step 06: Verification and clean-up


Day 3 – Lifecycle and Input Variables

Lifecycle Meta Arguments

  • Step 01: Default Terraform resource lifecycle
  • Step 02: create_before_destroy
  • Step 03: prevent_destroy
  • Step 04: ignore_changes
  • Step 05: Practical demonstrations

Terraform Input Variables

  • Step 01: Defining input variables
  • Step 02: Basic variable usage
  • Step 03: Interactive variable input
  • Step 04: CLI variable usage -var
  • Step 05: Variable files terraform.tfvars
  • Step 06: Custom variable files -var-file
  • Step 07: Automatic variable loading .auto.tfvars
  • Step 08: Environment variables TF_VAR_

Variable Types and Validation

  • Step 01: List variables
  • Step 02: Map variables
  • Step 03: Terraform functions (length, substring, lower, upper, contains)
  • Step 04: Variable validation rules
  • Step 05: Regex validation
  • Step 06: sensitive, bool, and number variables

Advanced Variable Types

  • Step 01: Object type variables
  • Step 02: Tuple type variables
  • Step 03: Set collection type
  • Step 04: Implementing advanced variable structures

Terraform Outputs

  • Step 01: Output values introduction
  • Step 02: Basic outputs
  • Step 03: Sensitive outputs
  • Step 04: Output with count
  • Step 05: Output with for_each
  • Step 06: Creating list outputs
  • Step 07: Creating map outputs

Terraform Local Values

  • Step 01: Introduction to locals
  • Step 02: Creating and using local values


Day 4 – Expressions, Data Sources and State

Terraform Conditional Expressions

  • Step 01: Conditional expression syntax
  • Step 02: Conditional logic in variables
  • Step 03: Conditional logic in resources
  • Step 04: Execute and verify configurations

Terraform Data Sources

  • Step 01: Introduction to data sources
  • Step 02: Data source for Resource Group
  • Step 03: Data source for Virtual Network
  • Step 04: Data source for Azure Subscription

Terraform Remote State and Locking

  • Step 01: Introduction to remote state
  • Step 02: Create Azure Storage Account and container
  • Step 03: Configure backend "azurerm"
  • Step 04: State locking and remote state verification
  • Step 05: State versioning and clean-up

Terraform State Commands

  • Step 01: terraform show
  • Step 02: terraform state list
  • Step 03: terraform state show
  • Step 04: terraform state mv
  • Step 05: terraform state rm
  • Step 06: terraform state pull and push
  • Step 07: terraform force-unlock
  • Step 08: Resource targeting with -target
  • Step 09: terraform apply -refresh-only

Terraform Workspaces

  • Step 01: Introduction to workspaces
  • Step 02: terraform.workspace variable
  • Step 03: Workspace commands (list, new, select)
  • Step 04: Managing resources across workspaces
  • Step 05: Workspace state files
  • Step 06: Workspaces with remote backend


Day 5 – Advanced Terraform Concepts

Terraform Provisioners (Usage and Best Practices)

  • (Note: Provisioners are discouraged except for special cases)
  • Step 01: File provisioner and connection block
  • Step 02: Creation-time provisioners
  • Step 03: Remote-exec provisioner
  • Step 04: Local-exec provisioner
  • Step 05: Provisioner error handling (on_failure)

Null and Time Resources

  • Step 01: Introduction to null_resource
  • Step 02: Triggers and provisioners
  • Step 03: Time-based resources

Terraform Import

  • Step 01: Introduction to terraform import
  • Step 02: Import existing Azure Resource Group
  • Step 03: Review state file and configuration
  • Step 04: Verification and clean-up


Terraform Modules

Terraform Modules Basics

  • Step 01: Introduction to modules
  • Step 02: Creating reusable modules
  • Step 03: Example: VNET module
  • Step 04: Using module outputs

Root and Child Modules

  • Step 01: Understanding root vs child modules
  • Step 02: Creating child modules
  • Step 03: Implementing root module
  • Step 04: Executing and verifying resources

Module Sources

  • Step 01: Local modules
  • Step 02: Git-based modules
  • Step 03: Terraform Registry modules

Publishing Modules

  • Step 01: Creating Git repository
  • Step 02: Publishing module to Terraform Registry
  • Step 03: Module versioning
  • Step 04: Using versioned modules

Private Module Registry

  • Step 01: Introduction to private module registry
  • Step 02: Git repository setup
  • Step 03: Publishing module to Terraform Cloud
  • Step 04: Using private modules in Terraform configurations


CONTACT US