
Meet your Terraform course instructor, Karan Gupta, a DevOps engineer with AWS certifications and a CKA, who guides you through a supportive, successful learning journey in cloud architecture and deployment.
Understand infrastructure as code (IaC) using Terraform to provision and manage servers, networks, and databases with code, enabling automation, consistency, scalability, environment replication, and version control.
Explore traditional infrastructure challenges—manual provisioning, high human effort, misconfigurations, slow deployments, lack of version control, configuration drift, and rising costs driving the shift to infrastructure as code.
Explore how infrastructure as code patterns separate provisioning and configuration, compare declarative vs imperative approaches, and highlight Terraform for provisioning with Ansible for configuration in multi-cloud contexts.
Learn how Terraform enables declarative, cloud-agnostic infrastructure as code, offering immutable changes, version control, and reusable modules, with a practical workflow from init to destroy.
Download the latest Terraform for macOS, install homebrew if needed, and run the setup commands to set the path. Verify the installation by checking the Terraform version.
Install and set up Visual Studio Code for Terraform development in this session, including installing the official Terraform extension, configuring GitHub Copilot, and applying themes.
Explore the Terraform file structure, from provider.tf and main.tf to variables.tf and output.tf, and learn how modules, .tfvars files, and environment variables shape resources.
Explore how Terraform providers deploy and manage infrastructure on cloud platforms like AWS, Azure, and GCP, translating configurations into API calls for resource creation, updation, and deletion.
Learn how to create a provider block in provider.tf for Terraform with AWS, specifying versions, region, and initialization steps to configure providers and manage dependencies.
Explore how to specify Terraform provider versions to ensure compatible, repeatable deployments, using exact, not equal, greater/less than, and tilde ranges (a.b.c) to manage updates.
Learn how Terraform authenticates to AWS, Azure, and GCP to select the deployment account. Use environment variables, credentials files, CLIs, and roles to ensure secure access and automate deployments.
Learn how resources define real-world infrastructure components in Terraform, using the main.tf syntax, to create repeatable, version-controlled deployments of servers, networks, and more.
Main.tf is the heart of a Terraform project, housing resources and provider details as the core configuration and entry point, with data and outputs for readability.
Create a basic EC2 using a single or split Terraform setup, configuring the AWS provider and main.tf resources with AMI, instance type, and tags.
Learn how terraform plan performs a dry run, compares current state with configuration files, and generates an execution plan that previews what will be created, changed, or destroyed.
Explore how to authenticate AWS in Terraform using hard-coded values, environment variables, and shared credentials, compare security trade-offs, and manage multi-environment access.
Explore configuring AWS credentials via the credentials file, and multiple profiles, including default and dev, using AWS CLI, environment variables, and profile switching.
Understand how Terraform apply executes the plan to provision, update, and delete AWS resources from your blueprint. Learn about auto-approve prompts and how the state file records provisioned infrastructure.
Understand the Terraform disperse command, an optional tool to delete all resources managed by Terraform, update the state, and reset the environment after confirmation.
Learn how the terraform dependency lock file (.terraform.log.sc) records exact plugin versions and checksums to ensure consistent provider versions, cross-environment integrity, and security verification against updates.
Understand how the json state file tracks resources, IDs, attributes, and dependencies, updates after each apply, and securely stores the current state locally or remotely.
Explore a practical hands-on of Terraform’s state file with AWS, showing how apply creates a state file containing instance details and enables rollback and destruction.
Discover how Terraform attributes reveal runtime values like EC2 IDs, public IPs, and ARNs after resource creation, enabling dynamic linking, state management, and reliable dependency resolution.
Demonstrate a hands-on approach to Terraform attributes, showing how instance id, public ip address, and private ip address become known after resource creation and are stored in the Terraform state.
Explore equitable cross-referencing in Terraform, using attributes from one resource to reference another, such as EC2 instance ID for Elastic IPs, ensuring correct creation order with dynamic, non-hardcoded values.
Learn how the terraform fmt command formats configuration files to enforce indentation and readability, with recursive formatting and diff output for pre-plan checks.
Learn how the terraform validate command cross-checks configuration syntax and resource references without creating resources, giving a heads-up before plan or apply and supporting CI/CD workflows with fmt.
Explore how resource dependencies govern creation order in Terraform, including implicit and explicit dependencies like depends_on, to build reliable multi-tier infrastructure.
Explore implicit resource dependency in Terraform by provisioning a security group and an EC2 instance, showing Terraform’s internal ordering and automatic resource creation.
Master explicit resource dependency in Terraform with depends_on by ensuring an S3 bucket is created before an EC2 instance.
Learn to use multiple providers in a single Terraform project, including AWS, Azure, and local, and initialize them with Terraform init to enable multi-provider infrastructure as code.
Explore how to declare and use variables in Terraform, master data types and precedence rules, and leverage tf.var, tfvars, and CLI overrides to create reusable, environment-aware configurations.
Learn how the variable block assigns a default value to a variable, enabling Terraform to run without input. Use a string variable like instance_type with t2 micro in AWS instance.
Discover how environment variables override default values in Terraform, declared outside configuration and exported, improving security for credentials and portability across local and CI-CD environments.
Learn how tfvars and tfforce files override variables in terraform, with a hands-on example that changes instance type from t2 large to t2 small using plan and apply.
Start by defining string, number, and bool data types; create variables and a Terraform AWS EC2 setup with an EBS volume, cross referencing availability zones, and enabling monitoring.
Explore the list data type in Terraform by declaring a string list of instance types like t2 micro, t2 small, and t2 nano, then access by index to provision instances.
Explore how the map data type in Terraform uses key-value pairs to select environment-specific instance types like t2 micro for dev and t2 large for production.
Discover how Terraform meta-arguments control resource behavior and dependencies, enabling you to create multiple resources with count or for each, manage lifecycle, and select providers.
Explore the Terraform count meta argument to create multiple identical resources, such as three AWS EC2 instances, with one resource block using count and count.index starting at zero.
Learn to use the for_each meta-argument with a map to create multiple AWS EC2 instances, assign unique keys for each, and compare with count for predictable addressing and safe updates.
Explore meta-argument hands-on for_each with set in Terraform, contrasting map versus set usage, and iterating unique string values with each.value in buckets.
Discover how the Terraform lifecycle meta-argument controls resource creation, updates, and deletion, including create before destroy, prevent destroy, and ignore changes for resource protection and safe deployments.
Explore the terraform lifecycle prevent_destroy meta-argument, which blocks deletion of critical resources like databases during terraform destroy, and learn through a practical AWS instance example how to enable this protection.
Master Terraform's lifecycle meta-argument create_before_destroy by ensuring a new resource is created before destroying the old one, demonstrated when changing an operating system without downtime.
Explore how the Terraform ignore_changes meta-argument prevents removing manually added tags by drift, showing how to specify ignored items and verify with plan results.
Learn how Terraform outputs reveal final resource details after apply, such as public IP addresses, IDs, and ARNs, via an output block in outputs.tf.
Explore locals in Terraform to reduce repetition and improve readability. Define local name values for concise aliases and reuse them across configurations.
Engage in a hands-on tutorial on using locals in Terraform to declare reusable values, define a provider and region, and create an S3 bucket with common tags for readability.
Learn how Terraform data sources fetch existing resources from AWS, Azure, or GCP in a read-only mode, use filters to narrow results, and avoid hard coding.
Perform a practical hands-on with terraform data sources to fetch details of an existing AWS S3 bucket, such as ARN and region, using outputs and plan and apply.
Learn how Terraform expressions blend variables, functions, operators, and values to produce dynamic results, covering literal expressions, variable references, resource references, and functions for resources, variables, and outputs.
Explore how to implement conditions in Terraform using the ternary operator to switch between T2Large for production and T2Micro for dev or testing, reducing duplication and enabling dynamic configuration.
Perform a hands-on Terraform exercise to provision an AWS EC2 instance using a variable environment for conditional logic: t2.large in production and t2.micro otherwise, with provider and AMI configuration.
Explore how Terraform functions transform, combine, and compute values dynamically, covering string, numeric, collection operations, date and time, file system, and type conversions for flexible, automation-friendly configurations.
Perform hands-on practice with terraform functions, exploring string operations (lower, upper, join) and numeric functions (max, min, power) using locals and a provider setup.
Discover how dynamic blocks in Terraform generate nested blocks with for loops, using maps and lists to create dynamic security group ingress and egress rules and server configurations.
Learn to replace repetitive ingress rules in a security group with a dynamic block in Terraform, using for_each and locals to manage multiple ports efficiently.
Learn splat expressions in Terraform to extract attributes from multiple resources created with count or for_each, returning IDs and public IPs via legacy and explicit syntax.
Learn how splat expressions in Terraform extract multiple values from count and for_each to output multiple IPs. See a practical setup creating three aws instances and retrieving their public IPs.
Terraform refresh updates the state file to reflect the current real-time infrastructure, detects drift from manual changes, and helps plan before apply without creating or destroying resources.
See how terraform refresh updates tfstate to reflect real-time infrastructure changes, and how terraform apply refresh only can confirm and apply those updates to instance types and state.
Discover how remote state files enable team collaboration by storing Terraform state in a centralized shared remote location, preventing conflicts and enabling version control with AWS S3 and other providers.
Explore how to configure a remote state file with a Terraform S3 backend for collaborative teams, including bucket creation, backend config, initialization, and remote state validation.
Demonstrates migrating local Terraform state to a remote S3 backend, including bucket creation, backend configuration, and using init to copy the local state.
Learn how the terraform state lock file prevents concurrent applies by locking the remote state in S3, enabling single transactions, data integrity, and safe team collaboration.
Learn to configure a DynamoDB state lock for Terraform's remote state, including creating a DynamoDB table, migrating the backend, and acquiring locks during plan and apply to prevent concurrent runs.
Learn to use S3 native locking for terraform state with a tflock file, replacing DynamoDB, and migrate state with init, plan, and apply during the 1.14+ upgrade.
Explore terraform state commands such as list, show, mv, rm, pull, and push to inspect, modify, and manage the state file for debugging and state migration without changing real infrastructure.
Learn how to enable Terraform logs with environment variables, understand log levels from trace to error, and use tf.log to diagnose provider behavior, authentication, and state issues.
Enable terraform logs with tf.log by exporting the variable, choose a category such as debug or info, and route output to abc.txt for easier debugging.
Learn how tainting a Terraform resource marks it for destruction and recreation on the next apply, aiding troubleshooting and testing for corrupted or updated cloud resources.
Terraform taint marks a resource for recreation after manual changes, then plan and apply recreate an AWS EC2 instance in North Virginia, with logs detailing taint, replacement, and destruction.
Learn to use Terraform replace with apply to replace a resource, such as an aws_instance, by destroying and recreating it for seamless state management.
Drift changes occur when manual or external updates bypass terraform, causing inconsistencies and security risks; apply terraform plan and drift detection to prevent them.
Detect drift changes when manual edits are made to a Terraform-created resource during plan and apply. Refresh the state file and revert to the declared configuration, removing the dev tag.
Learn how to use Terraform import to bring existing infrastructure under Terraform management, handle drift, recognize legacy resources, and recover a lost state without disrupting live environments.
Visualize Terraform graph to map dependencies among resources, data sources, and providers, revealing architecture and interdependencies. Generate diagrams in dot or png to analyze dependency order and identify circular dependencies.
Explore Terraform modules, including root, child, local, and remote registry modules, to organize, reuse, and standardize infrastructure with variables, outputs, and one module one responsibility.
Practice hands-on with Terraform registry modules, calling AWS S3 bucket module from HashiCorp registry, configure provider and version, initialize, plan, and apply to create buckets with optional inputs and outputs.
Execute a custom module hands-on by publishing a Terraform module on GitHub and calling it to provision an AWS EC2 instance in North Virginia using plan and apply.
Create and test local Terraform modules by reusing an EC2 module, referencing a local path, and running init, plan, and apply to provision instances.
Explore how Terraform workspaces manage dev, test, and production environments with a single configuration and separate state files. Gain insights into simpler setups, code reuse, quick switching, and environment isolation.
Minimize Terraform provisioners, as they run scripts on created resources with limited Terraform control, and use them only for bootstrapping or final configuration via local-exec, remote-exec, or file provisioners.
Execute commands and scripts on a remote EC2 instance after resource creation using the Terraform remote-exec provisioner, enabling package installs, OS configuration, and service management via SSH.
Explore remote-exec provisioners in Terraform, using a null resource to run commands on an EC2 instance via SSH and install nginx, with triggers and connections.
Learn how the local-exec provisioner runs commands on the terraform host with no remote connections. Use it for ci/cd integration, triggering local scripts, and generating reports.
Learn how to use the local-exec provisioner in Terraform to run a command locally and save a server's public IP to a file, using AWS provider, and applying Terraform.
Explore how file provisioners copy files and directories from your local machine to a remote server to provide scripts for remote execution, without executing commands.
Learn how to use the file provisioner in Terraform to copy scripts from local to a remote EC2 instance, including key pair setup, SSH access, and securing a private key.
HashiCorp Certified: Terraform Associate – Complete Exam Preparation
Are you preparing for the HashiCorp Certified: Terraform Associate exam and want a structured, practical, and exam-focused course?
This course is designed to help you understand Terraform from fundamentals to certification-level depth, with hands-on demonstrations and realistic practice tests aligned with the latest exam objectives.
Whether you're a DevOps engineer, Cloud engineer, System administrator, or aspiring Infrastructure as Code professional, this course will help you confidently pass the certification.
What You Will Learn
Terraform core concepts and workflow
Infrastructure as Code (IaC) fundamentals
Providers, resources, and data sources
Variables, outputs, and locals
Terraform state management
Modules and reusability
Workspaces and environment isolation
Backend configuration and remote state
Terraform CLI commands in detail
Debugging and troubleshooting
Exam-focused scenario-based questions
Practice Tests Included
This course includes:
Multiple full-length mock exams
Scenario-based questions similar to the real exam
Detailed explanations for every answer
Exam strategy tips and time-management techniques
Hands-On Demonstrations
You will see practical examples covering:
Writing Terraform configuration files
Deploying infrastructure on cloud providers
Managing state files
Using modules in real-world setups
Handling variables and environment configurations
Who This Course Is For
DevOps Engineers
Cloud Engineers
AWS/Azure/GCP Professionals
System Administrators
Beginners starting with Infrastructure as Code
Anyone preparing for the Terraform Associate certification
Why Take This Course?
Structured according to official exam objectives
Real-world practical understanding
Clear explanation of key Terraform concepts
Practice exams to test your readiness