
Explore infrastructure as code and learn how to manage and provision servers, networks, and databases with code using Terraform, gaining benefits like automation, consistency, and scalable deployments.
Identify the challenges of traditional infrastructure, including manual provisioning, misconfigurations, and slow deployments. Learn why teams shift to infrastructure as a core to improve consistency, scalability, and reduce cost.
Explore types of infrastructure as code, comparing provisioning with Terraform and CloudFormation to configuration with Ansible, Chef, and Puppet, and compare declarative versus imperative approaches.
Explore Terraform, an open-source infrastructure-as-code tool by HashiCorp, enabling cloud-agnostic, declarative infrastructure with a workflow of write, init, plan, apply, and destroy.
Install Terraform on macOS by downloading the latest macOS version, installing Homebrew, configuring the PATH, and verifying the Terraform version for a smooth setup.
Learn to install Visual Studio Code across macOS, Windows, and Linux, then configure it for Terraform development with the official Terraform extension.
Explore how AWS IAM controls access to resources by managing users, groups, roles, and policies. Maintain security and compliance by granting authorized actions and enabling fine-grained, temporary access for applications.
Compare IAM users and IAM roles to reveal their differences in authorization and authentication, long-term versus temporary credentials, and practical AWS use cases with policies.
Explore IAM policies that grant permissions to users, groups, and roles via JSON statements, including effect, actions, resources, and conditions, and create inline and custom policies.
Learn why attaching policies to IAM users grants permissions for actions like create, delete, and update, with hands-on steps to attach policies and review access using access advisor.
Learn how AWS access keys enable programmatic access via CLI, SDKs, and HTTP APIs by generating access key IDs and secret keys in IAM, and configuring them with AWS CLI.
Explore aws ec2, the elastic compute cloud hosting virtual server instances with configurable cpu, memory, storage, and networking. Learn to launch and secure an ec2 instance across operating systems.
Launch an EC2 instance in AWS by selecting an Amazon Linux AMI, using a key pair, choosing a T2 micro size, configuring a security group, and assigning 8 GB storage.
Explore the Terraform file structure, including provider.tf, main.tf, variables.tf, output.tf, and tfvars files, and learn why each file defines providers, resources, variables, and outputs.
Understand how a Terraform provider connects configurations to cloud platforms via provider plugins for resource creation, updation, and deletion; specify the provider and authenticate to manage AWS, Azure, and GCP.
Learn to create a provider.tf file for AWS, configure the provider block with a version and region, and run Terraform init to initialize plugins and dependencies.
Learn how to control Terraform provider versions to ensure consistent deployments and avoid breaking changes. Explore exact, not equal, and range constraints, including tilde ranges, for reliable upgrades.
Authenticate Terraform to deploy on cloud providers like AWS, Azure, and GCP using provider-specific methods, enabling secure access, preventing unauthorized changes, and enabling automation.
Explore resources as the building blocks Terraform creates, defining the desired infrastructure state, and learn the resource syntax in main.tf, including provider, name, and key-value pairs for repeatable deployments.
Discover how the main.tf file serves as the heart of a Terraform project, defining resources, core logic, and provider details.
Explore hands-on crafting an aws ec2 instance in main.tf using the aws provider, defining ami, instance_type, and tags to deploy resources with Terraform.
Learn how to use Terraform plan to preview proposed changes, compare current state with configuration, and safely visualize what will be created, changed, or destroyed before applying.
Explore common AWS authentication methods for Terraform: hard-coded credentials, environment variables, and shared credentials, including using the AWS CLI, export commands, and multiple profiles across environments.
Learn three AWS authentication methods by managing credentials files and profiles, including hardcoding variables, aws cli environment variables, and labeled profiles like default and deploy.
Learn how Terraform apply executes the planned changes, provisions resources in AWS, and updates the state file, with guidance on auto-approve and confirming execution.
Terraform destroy deletes all resources provisioned, updates the state file, and restores a clean environment. Confirm destruction and use the optional terraform destroy for practical clean-up.
Explore the dependency log file, which records provider versions and checksums to ensure consistency across environments, verify integrity with hashes, and update only when versions change.
Understand the terraform state file, a JSON record created automatically after the first apply. It tracks resources, IDs, attributes, and dependencies to map configuration to resources and updates with changes.
Explore practical state file concepts in Terraform by hands-on creation and destruction of an aws ec2 instance, observing how the state file stores full deployment details and supports rollback.
Learn how the terraform state backup file (terraform.tfstate.backup) enables rollback, recovery, and troubleshooting by preserving the previous state and guiding safe recovery when state changes go wrong.
Compare current state and the desired state in Terraform, using tf state file and configuration files, and see how plan and apply generate changes to reach the desired infrastructure.
Contrast the current state in the terraform state file with the desired state defined in configuration, illustrating adding a second EC2 instance via apply.
Identify how attributes reveal runtime values (public IP, private IP, ARN, instance ID) after Terraform apply. Explore dynamic linking and state management through attribute references for wiring resources.
Explore practical attributes in Terraform by creating an EC2 resource, and observe computed values like instance ID, public IP, and private IP after apply and in the state file.
Understand public, private, and elastic IPs, how public IPs change on restart, and how elastic IPs provide a fixed address for failover, while private IPs stay fixed.
Explore attribute cross-referencing in Terraform, linking an EC2 instance ID to an Elastic ID and Elastic IP in the correct creation order for dynamic configuration.
Format your terraform configurations with the terraform fmt command to enforce proper indentation, standard file style, and readable, consistent code across teams before planning or applying.
Explore the terraform validate command, which cross checks syntax, references, and required arguments without modifying resources, and why to run it before plan and apply in a CICD workflow.
Understand how security groups act as virtual firewalls for EC2 instances, controlling inbound traffic with stateful rules. Learn how default outbound behavior works and how to create and attach them.
Explore AWS S3, its bucket and object structure, and how scalable storage enables global access, with use cases like backup, data archiving, application hosting, and disaster recovery.
Explore Terraform resource dependencies and how implicit and explicit dependencies determine creation order, including multi-tier scenarios and the depends_on approach for ensuring correct sequencing.
Explore implicit resource dependency in Terraform, where Terraform automatically orders resource creation, demonstrated by creating a security group before an EC2 instance.
Learn how explicit resource dependency uses depends_on to enforce creation order between resources like an S3 bucket and an EC2 instance, demonstrated with Terraform plan and apply.
Learn to configure and run multiple providers in a single Terraform project, including AWS, Azure, and local providers, and initialize them with terraform init.
Explore how Terraform variables parameterize configurations, cover data types such as string, number, bool, list, map, set, and tuples, and manage precedence from default to tf.var and cli overrides.
Learn how the terraform variable block assigns default values as a fallback when no input is provided, declare it in variables.tf, and reference it in main.tf.
Explore how environment variables override defaults in Terraform, declare them outside config, and securely pass sensitive data in CI/CD, as shown by changing an instance type from t2-micro to t2-large.
Demonstrate Terraform variable precedence with tfforce files and tfwars files, showing how to override default and environment values using named files and practical plan and apply steps.
Explains auto.tfvars usage in ci/cd, highlighting automatic loading and precedence, with a practical example of changing an instance from t2 small to t2 nano via plan and apply.
Explore how cli var flags give precedence to Terraform variables during plan and apply, with hands-on instance type changes and guidance to use tfvars or environment variables in production.
Explore cleaning up Terraform variables and resource costs by using Terraform destroy to terminate instances, understanding variable precedence across multiple files, with examples using instance type, tags, and AMIs.
Explore hands-on data types in Terraform by working with string, number, and bool, configuring variables, and attaching an AWS EC2 instance with an EBS volume and monitoring settings.
Learn best practices for organizing terraform configuration files by splitting into provider.tif, main.tif, and variables.tif, and practice plan and destroy with auto approve.
Master using lists in Terraform to declare multiple values of the same type, index elements like t2 micro, t2 small, t2 nano, and use count for scalable AWS instances.
Explore how the map data type maps keys to values to select environment-specific instance types, such as T2 micro for dev and T2 large for production, using Terraform variables.
Learn how Terraform meta arguments like count, for each, depends on, lifecycle, and provider configurations control resource creation, dependencies, and drift handling to build modular, automated infrastructure.
Master the Terraform count meta argument to create multiple identical resources with a single block, using count = 3, count.index, and index starting at 0 to reduce code duplication.
Explore for_each with map and set in terraform to create multiple EC2 instances with unique attributes using t2 micro and t2 small, comparing it to count and highlighting predictable addressing.
Use for_each with set to create unique AWS S3 buckets, compare with map keys and values, and reference each.value from the buckets set.
Explore Terraform's life cycle meta-argument to manage creation, update, and deletion, including create before destroy, prevent destroy, and ignore changes for resource protection and high availability deployments.
Learn how the terraform lifecycle prevent_destroy meta-argument protects critical resources from accidental deletion, with a practical AWS example showing how to enable and later remove it to permit deletion.
learn how terraform's create before destroy lifecycle rule creates a new resource before destroying the old one, enabling seamless updates when changing an ami or operating system.
Explore how to use the lifecycle ignore_changes meta-argument to ignore manual tag edits on a server, prevent drift, and keep Terraform plans stable.
Explore how Terraform outputs expose final resource details, such as public IPs and ARNs, via the output block and outputs.tf to enable debugging and automation.
Explore the locals concept in Terraform to define local name values and create concise aliases. Reduce code duplication, simplify expressions, and improve readability with locals through practical, hands-on examples.
Learn to use Terraform locals to declare reusable values and common tags, then configure the AWS provider and deploy an S3 bucket.
Explore how Terraform data sources fetch existing resource details from providers like AWS, enabling read-only access to amis and regions while avoiding hard coding.
Learn how to use Terraform data sources to fetch existing resource details like an AWS S3 bucket ARN and region, and output them for use in plans.
Learn to write clean terraform code by avoiding hard coded values, using cross referencing and data sources for s3 bucket details, and validating with plan and apply.
Explore how expressions combine variables, functions, operators, and values to produce results. See how expressions power resource arguments, variables, locals, outputs, and loops with literals, references, and functions like upper.
Apply conditions in Terraform to select resources by environment, using a ternary operator to choose T2Large for production and T2Micro for dev, reducing duplication.
Learn hands-on terraform conditions by provisioning an AWS EC2 instance based on an environment variable. Implement conditional logic to use t2 micro for dev and t2 large for production.
Understand how Terraform functions transform, combine, and compute values to make configurations flexible and automation friendly, covering string, numeric, collection, file system, date/time, and type conversion functions.
Explore hands-on Terraform functions, using string operations like lower, upper, and join, and numeric operations like max and power, with local variables and practical Terraform workflows.
Explore collection and time-date functions in Terraform through hands-on exercises, including length, contains, and timestamp, using locals, lists, and practical examples.
Master dynamic blocks in Terraform to generate nested resources with for loops and for each loop, using maps and lists to model security group ingress and ports.
Explore dynamic blocks in terraform with a hands-on security group example, converting multiple ingress rules into a concise, readable configuration using for each and locals.
Explore splat expressions in Terraform, learning how to extract attributes from multiple resources created with count or for_each using legacy and explicit syntax to obtain IDs and public IPs.
Master splat expressions in Terraform by provisioning three AWS instances with count and extracting their public IPs in a single output using the asterisk.
Learn to fetch AWS AMIs for Terraform EC2 using data sources instead of hard-coded IDs, with filters for name, owner, most recent, and Ubuntu images.
Learn how Terraform refresh updates the state file to reflect real-time infrastructure, detect drift, and plan before applying changes against AWS resources.
Learn hands-on how Terraform refresh detects real-time infrastructure changes not in config, compare refresh with apply refresh only, and observe EC2 state file updates.
Explore how remote state files store the Terraform state in a shared remote location, enabling team collaboration, conflict prevention, and secure, centralized version control using AWS S3.
Configure a remote state file using an S3 backend for Terraform to enable team collaboration, then initialize, plan, and apply to manage resources and update the remote state.
Demonstrate migrating local Terraform state to a remote S3 backend, including initializing, copying local state, and validating plan and apply as you switch to a remote state.
Explore how the terraform state lock file coordinates concurrent apply commands, ensuring data integrity and team collaboration by locking the remote state stored in S3.
Explain using DynamoDB as a state lock file for Terraform's remote state backend—a deprecated yet still used method—covering lock table creation and init, plan, apply to manage concurrency.
Learn how to enable S3 native state locking for Terraform by using the S3 backend's lock file, migrate from DynamoDB, and upgrade to recent Terraform versions.
Explore Terraform state commands to inspect, modify, and manage the state file safely, enabling debugging, refactoring across environments, and state migrations without changing real infrastructure.
Enable terraform logs using environment variables, select log levels from trace to error, and use tf.log to analyze provider behavior, authentication, state issues, and a failed plan or apply.
Activate terraform logs by exporting tf.log and selecting a category (debug, info, warn, or error), initialize and run plan, and optionally direct output to a log file.
Explore Terraform taint, a mechanism to force recreate resources on the next apply, with practical examples of tainting, untainting, and using Terraform state show to verify status.
Explore Terraform taint to recreate resources when manual changes occur. The session demonstrates tainting an AWS EC2 instance, planning and applying recreation, and introduces Terraform apply replace as an alternative.
Replace resources with terraform apply using the replace section to recreate a server. Learn how aws_instance resources are replaced by destroying and recreating with user confirmation.
Identify how drift changes occur when manual or external updates bypass Terraform, and adopt best practices like plan, drift detection, refresh, and treating Terraform as the single source of truth.
This session demonstrates drift changes in Terraform using a hands-on EC2 example, showing how manual edits trigger drift, how the plan detects it, and how state is refreshed and reverted.
Apply the Terraform lifecycle rule ignore changes in a hands-on session to manage irrelevant updates like tags, using main.tf, and verify with Terraform plan to see no changes.
Learn how to use Terraform import to bring existing infrastructure under Terraform management, handle drift, recover lost state, and manage legacy resources without recreating servers.
Visualize Terraform dependencies by using the Terraform graph command to map resources, data sources, and providers, revealing creation order, interdependencies, and potential circular dependencies for architecture reviews.
Understand Terraform provisioners, including local-exec, remote-exec, and file provisioners, and why Terraform minimizes their use for bootstrapping, initial setup, and final configuration when cloud native solutions fall short.
Learn how HashiCorp utility providers in Terraform enable key pair creation, local file downloads, TLS and encryption scenarios, and null resources for real-time tasks on the local system.
Create EC2 instance with a generated key pair using Terraform, leveraging TLS to generate a private key and local to save it, then attach the key pair to the instance.
Master the null resource in Terraform under the NullProvider to run provisioners like remote and local execute scripts without creating resources, using triggers for re-runs in CI/CD.
Understand how to use the remote-exec provisioner in Terraform to run commands on a created remote server for tasks like package installation, OS configuration, and scripts via SSH.
Learn to use the remote-exec provisioner with a null resource to run commands on an AWS EC2 instance, install nginx, and verify with Terraform plan and apply.
Explains how the local-exec provisioner runs commands on the Terraform running machine, enabling local scripts, CICD integration, and generating reports without remote access.
Demonstrate the local-exec provisioner in Terraform by running a local command to capture a server's public IP and save it to serverinfo.txt during apply.
Copy files from your local machine to the remote server with the file provisioner, enabling scripts and configuration to be available without executing commands.
Learn to use Terraform's file provisioner to copy a local file to a remote EC2 server, including key pair generation, SSH connection, and a hello world script deployment.
Terraform: Beginner to Expert Guide | 3-Level Interview Prep
Master Infrastructure as Code (IaC) using Terraform and prepare for real-world DevOps roles with this comprehensive course designed for Beginners, Intermediate learners, and Advanced professionals. This course not only teaches Terraform from scratch but also prepares you to confidently handle DevOps interviews at three levels: Beginner, Intermediate, and Expert.
Terraform is one of the most widely used tools for provisioning and managing infrastructure across cloud platforms such as AWS. In this course, you will learn how to automate infrastructure deployment, manage environments efficiently, and follow industry best practices used by DevOps engineers.
The course begins with the fundamentals of Infrastructure as Code and Terraform, helping beginners understand core concepts such as providers, resources, variables, outputs, and Terraform workflow. You will learn how Terraform interacts with cloud providers and how to create your first infrastructure using simple configuration files.
As you progress, you will move into intermediate-level Terraform concepts including modules, remote state management, workspaces, provisioners, dependency management, and state file handling. These topics help you design scalable and maintainable infrastructure for real-world environments.
In the advanced section, you will explore enterprise-level Terraform practices such as reusable modules, Terraform Cloud, team collaboration, governance, validation, drift detection, Sentinel policies, and complex infrastructure automation strategies.
A unique highlight of this course is the 3-Level Interview Preparation, where you will learn commonly asked Terraform interview questions categorized into:
Beginner-level DevOps interviews
Intermediate-level cloud automation interviews
Expert-level infrastructure architecture discussions
You will also gain hands-on experience through practical labs and real-world scenarios, helping you understand how Terraform is used in production environments.
By the end of this course, you will be able to:
Write and manage Terraform configurations confidently
Automate cloud infrastructure deployments
Design modular and reusable infrastructure code
Work with Terraform state management and collaboration tools
Prepare effectively for Terraform and DevOps interviews at multiple experience levels
Whether you are a beginner starting your DevOps journey, a cloud engineer looking to strengthen Terraform skills, or a professional preparing for DevOps interviews, this course will provide the practical knowledge and confidence needed to succeed.
Start learning Terraform today and take your DevOps and cloud automation skills to the next level.