
Explore the course agenda, learn why terraform for infrastructure as code, and dive into blocks, variables, data sources, state, workspaces, registry, policy as code, modules, and ci/cd.
learn how infrastructure as code uses a declarative approach to spin up compute, storage, and network across multi-cloud targets, ensuring a desired state and consistency with tools like Terraform.
Terraform enables infrastructure as code with declarative configuration files, plan and apply workflows, and supports multi-cloud and on-prem providers, using modules and state management for consistent, repeatable infra.
Install Terraform CLI on Linux using apt from the HashiCorp repository, covering Ubuntu and Debian family steps, repository setup, apt update, and apt install, plus verification of version 1.8.4.
Install Terraform CLI on Windows by downloading the zip, unzipping, and placing the binary in an executable path. Update environment variables to include the path and verify with terraform --version.
Identify the target provider and author Terraform configurations to provision infrastructure via the execution plan. Initialize, plan, and apply to provision resources, then perform post-validation checks.
Explore the Terraform workflow for applying and destroying resources, including init, fmt, validate, plan, and apply, with Azure provider plugins, modules, and CI/CD considerations.
Explore terraform workflow commands, including init, fmt, validate, plan for apply and destroy, then apply and destroy, with a hands-on demo to spin up resources on the provider.
Initialize the working directory with terraform init to download the Azure provider plugin into the .terraform directory and define required_version and required_provider in the Terraform settings.
Learn how to use the terraform fmt command to format .tf files across the current directory and subdirectories with -recursive for consistent indentation and style, and see formatted output.
Terraform validate checks configuration syntax and required arguments in resource blocks, without validating actual values. Run after init and on changes to catch issues before apply.
Preview Terraform changes by comparing the configuration's desired state with the provider state, revealing create, update, or destroy actions before apply or destroy; learn destroy and refresh-only modes.
Terraform apply executes actions from the plan and prompts for confirmation before creating resources on Azure; use a plan file or auto-approve for CI/CD, with state in terraform.tfstate.
Discover how the Terraform destroy command reads the Terraform state file to plan deletions, targets ephemeral infrastructure, and supports auto-approval in dev environments while avoiding production.
Explore Terraform blocks, including settings block, provider block, input block, local block, output block, data source block, and modules, with nested blocks such as back end and life cycle.
Explore how the Terraform settings block defines the target provider and remote state backend, with required providers, version constraints, and terraform init -upgrade.
Learn how to define a Terraform resource block to create Azure objects such as resource groups, with proper syntax, naming rules, and meta arguments like depends_on and count.
Master Terraform input variables, local values, and outputs to create reusable configurations, using blocks, defaults, types, validation, and nullable or sensitive options, and passing values via cli or env vars.
Define input variables in a variables.tf file, such as vnet name and address, call them with var in VNet and subnet resources, and run init, fmt, validate, plan, and apply.
Explore how Terraform updates a subnet in place when changing CIDR values, read the plan, and master variable precedence from CLI -var to tfvars files and environment variables.
Define and apply local values to manage common tags across Azure resources in Terraform, using merge to combine resource-specific tags with shared environment and team tags.
Define Terraform output values to print resource group, subnet, and virtual network IDs from the state file, using output blocks and plan, apply, and refresh commands.
Explore Terraform meta arguments to control resource behavior, including depends_on, count, for_each, provider, and lifecycle, with practical examples of resource ordering, multi-resource blocks, and create before destroy strategies.
Apply the depends_on meta-argument in Terraform to control creation order across resource and module blocks, ensuring a virtual network, subnet, network interface, and Linux VM are created in sequence.
Add a public IP to a virtual machine by creating a public IP resource and binding it to the network interface via depends_on, plan, and apply.
Explore using the count meta-argument in Terraform to create multiple identical network interfaces for a Linux VM, using index-based name suffixes and plan and apply verification.
Explore the for_each meta-argument in Terraform to create multiple resources from one block, using list or map data with each.key or each.value, Azure resource groups.
Delve into Terraform's lifecycle meta-argument, covering create before destroy, ignore changes, and prevent destroy, with demos on replace, precondition, and postcondition.
Demonstrate how the life cycle meta argument replace triggered by controls resource replacement, showing in-place updates versus recreation of a Linux VM when subnet values change.
Leverage Terraform data source blocks to fetch Azure resources and an SSH public key, then reuse that data in VM configurations with clear syntax and examples.
Use a data source block to read outputs from a Terraform remote state and reuse them to spin up a Linux VM, network interface, and public IP in Azure.
Compare count and for_each in Terraform for Azure resource groups from a list of strings; use length for dynamic count and switch to for_each to avoid replacement.
Learn how Terraform state stores current and backup state in local and remote backends, with workspaces, and how plan, apply, destroy, and state commands manage resources.
Explore how terraform state files work locally—from init to apply and plan—keeping locks and current versus backup state for resource groups and storage accounts.
Terraform state files store the current infrastructure data in json, including version, serial, lineage, outputs, and resources managed by your configuration, whether stored locally or remotely.
Learn how to fetch and inspect data from a local Terraform state file using commands like Terraform state list and Terraform state show for dev and prod resources.
Store Terraform state remotely in Azure Blob storage with a backend configuration, enabling versioning, locks, and safe state management across environments.
pull and push the terraform state between the remote azure storage backend and the local system, including migrating between local and remote backends with terraform init migrate state.
Demonstrates how to pull and push Terraform state between remote Azure backends and local systems. Shows migrating backend configurations with Terraform init migrate state to ensure consistency.
Manage terraform state locks to prevent concurrent plan, apply, or destroy operations; using a remote backend centralizes the state and enforces a lock, while force unlock resolves interrupted locks.
Rename a resource group in Terraform by moving its state with terraform state move, then validate with plan and use state list to ensure no recreation.
Explore Terraform workspaces to deploy resources across dev, stage, and production from a single configuration, manage multiple environments with a shared configuration file, and store separate state per workspace.
Explore how to use Terraform workspaces to separate environments like dev and prod, switch between them, and map resource configurations to the active workspace for resource groups and storage accounts.
Create resources in the default workspace with terraform plan and apply, and observe the state file. Switch between default, dev, and prod workspaces.
learn how to manage terraform workspaces with a remote backend, create dev and prod environments, store state files remotely, and note that the default workspace cannot be deleted.
Override to static names for Terraform state files by workspace with a backend config in Azure cloud, using Terraform init -backend-config and Terraform workspace show.
Understand how Terraform modules enable reuse across teams by bundling resource blocks for Azure into modules, and pull or publish modules from private or public registries.
Learn the Terraform module workflow, from writing provider configurations to packaging a reusable module via a registry, and understand the root and nested module structure with variables, outputs, and examples.
Discover how to use a public registry module to create an Azure vnet with subnets, by configuring the module block, variables, and provider settings.
Build a Terraform module for a VNet and virtual machines, called from a root module. Manage variables and outputs across the VNet and VM modules in a local modules directory.
Spin up a VNet, subnets, public IP, and Linux virtual machine using a path-based Terraform module, while practicing init, fmt, validate, plan, apply, and destroy with a shared state.
Learn to read data from a Terraform state file, pulling outputs like network interface IDs, resource group, and location to configure a VNet and instance, with local or remote state.
Create an HCP Terraform free account on terraform.io, verify your email, set up an organization with projects and teams, and explore workspaces and the registry.
Navigate the HCP Terraform hierarchy: organization, project, and workspaces, and learn how to segregate resources by environment (dev, prod) for clear governance and permissions management.
Understand HashiCorp cloud platform pricing models, including pay as you go, flex, essential, standard, and premium, and how credits, organization billing, and plan changes affect Terraform usage.
Create a Terraform workspace linked to GitHub to provision Azure networking resources (resource group, vnet, subnets, NIC) with outputs and development environment tags using a VCS-driven workflow.
Learn to configure Azure service principal authentication for a CI workflow by creating an app registration, generating a client secret, and assign arm_ prefixed environment variables and network contributor role.
learn to trigger terraform apply from a ci pipeline by pushing changes to the main branch, running plan, and confirming apply to spin up resources in the dev environment.
Destroy Terraform resources from the UI by generating a destroy plan in the workspace and applying it to delete five resources, including NIC, public IP, subnets, and resource group.
Demonstrates destroying Azure resources via Terraform from a CI workflow: push changes, run plan and apply to destroy, and verify in the portal; manage destruction through version control.
Explore managing multiple environments with Terraform workspaces in a single repository, using environment-specific variable files and branching strategies for dev and prod deployments.
Connect dev and prod Terraform workspaces to enable continuous delivery and deployment with run triggers, auto apply, and automated plan and apply in Azure cloud.
Learn how linked workspaces in Terraform manage destroy operations across dev and prod, including how a dev destroy plan can trigger prod and how to confirm and apply.
Explore terraform built-in functions for data transformation, including lower, reading yaml, and reconstructing data with locals, plus validations across configurations. Use them across locals, outputs, and resources.
Learn how dynamic blocks manage Azure network security group inbound rules inside a single resource, using a variable list to drive rules.
Explore secrets management in Terraform using environment variables for local and ci/cd usage. Secure credentials with tf_var_ prefix and encryption via HashiCorp Vault or cloud secret managers.
Terraform deep dive shows variable condition checks with a validation block enforcing east US and class A private CIDR for VNet address space, using startswith, split, and logical operators.
Use Terraform's lifecycle meta argument to define precondition and postcondition checks for resources and data sources. Learn practical validation techniques and how to use self for post conditions.
Explore precondition and postcondition lifecycle checks in Terraform to validate subnet CIDR slash 24, public IP location, and resource group alignment; learn through plan, apply, and data source validations.
Explore Terraform output precondition checks, validating subnet IDs before state storage, using all true logic to print only enabled subnets and show clear error messages.
Explore Terraform map(string) variables under type constraints, replace lists with unique values using two set, and extract key value pairs from map of strings with for each and outputs.
Master map(object) variables in Terraform with type constraints, learn to specify location and tags as strings or maps, and access values using each dot value for outputs.
Demonstrates using a map of map of object in Terraform with a lookup function to select dev or prod settings, spinning up resource groups in west or east US.
Read and apply environment-specific YAML data in Terraform by decoding YAML files. Use locals to centralize data and conditionally create resource groups with location and tags for dev and prod.
This course is designed for cloud engineers, DevOps professionals, and IT architects who want to master Terraform for building and managing scalable, secure, and production-ready infrastructure on Microsoft Azure Cloud using Terraform Community(CLI) and HCP Terraform/Enterprise.
You’ll gain a deep understanding of Infrastructure as Code (IaC) principles and learn how to automate Azure resource provisioning using Terraform. Through hands-on labs and real-world scenarios, you’ll explore advanced Terraform concepts, best practices, and enterprise-level workflows.
What you’ll learn:
Core Terraform concepts: providers, state management, variables, outputs, and modules.
Setting up Terraform with Azure and authenticating using service principals.
Building reusable modules for scalable Azure infrastructure.
Managing Terraform state with Azure Storage and remote backends.
Implementing environment-specific deployments (dev, test, prod).
Handling secrets and sensitive variables securely (Azure Key Vault, Vault).
CI/CD integration with GitHub Actions / Azure DevOps pipelines.
Best practices for collaboration, code versioning, and drift detection.
Real-world case studies: networking, compute, storage, and identity management in Azure.
Advanced features: workspaces, for_each, dynamic blocks, DR(Disastor Recovery) Stratagies and Policy as Code.
Who this course is for:
Cloud & DevOps engineers managing Azure environments.
Developers and sysadmins looking to adopt Infrastructure as Code.
Teams migrating from manual deployments to automated, consistent infrastructure provisioning.
Anyone preparing for Azure or Terraform certifications.
By the end of this course, you will be able to confidently design, provision, and manage Azure infrastructure using Terraform with enterprise-grade practices.
Duration: approx 40 days if you spend daily 1.5 hrs
TODO: Sentinel Policies(In-progress)