
Learn Terraform basics and production-ready practices to provision AWS and Google Cloud Platform resources, create VM instances and a simple web server, and apply infrastructure as code.
Discover how Terraform lets you write infrastructure as code to provision resources across AWS, Google Cloud, Azure, and more with a simple configuration language.
Install Terraform on Windows by downloading 64-bit zip, extracting the executable, placing it in a folder, adding that folder to system path, and verifying installation with terraform version.
Install terraformed on Mac by downloading the zip, unzipping, and moving the executable to /usr/local/bin, then run a quick check to confirm it works and remove temporary files.
Learn to install and configure Visual Studio Code for Terraform on Ubuntu, install the HashiCorp Terraform extension, and enable format on save for clean, colored code.
Configure the aws provider, set region and credentials, then plan and apply to provision resources and update the state file.
Learn how to update AWS resources with Terraform, using plan and apply to perform in-place updates or replacements, modify tags, keys, and instance types.
Destroy resources by removing them from your Terraform file or deleting the file, then run plan to see what will be destroyed and use Terraform destroy to remove everything.
Install cursor ai on ubuntu 20.04, configure it as a desktop app in /opt with a desktop entry, and install the Terraform HashiCorp extension with format-on-save.
HashiCorp updated their AWS Provider and now when you create SecurityGroup, you have to set vpc_id.
In many lessons we are using default VPC, which already pre-created by AWS in every Account, in order to set vpc_id for securitygroup we just need to add two more lines of code:
1. TO GET VPC ID: resource "aws_default_vpc" "default" {}
2. To SET VPC ID: inside block of resource "aws_security_group" add this line: vpc_id = aws_default_vpc.default.id
Build a simple aws web server using terraform, provisioning an instance, a security group, and an Apache setup via user data for automatic startup and web access.
Learn to bootstrap a simple web server in Terraform by moving user_data to an external file and referencing it with the file function, enabling code separation.
Learn how to use Terraform dynamic blocks to replace many ingress and egress blocks with a single dynamic block driven by a list of ports, simplifying security group configurations.
Explore how Terraform controls resource provisioning order by default and with explicit dependencies using depends_on, ensuring security groups precede instances and parallel creation is managed.
Explore how to use Terraform outputs to print private and public IP addresses, security group IDs, and other resource attributes, and manage exporting selective details during provisioning.
Generate, store, and retrieve secrets with Terraform using the SSM parameter store, creating a random password and saving it as a secure string for database access.
Learn to generate, store, and retrieve passwords with AWS Secrets Manager using Terraform, including creating a secret, version management, and retrieving values for apps, with handling dependencies and JSON data.
Explore using Terraform's ephemeral blocks to generate and reference secrets without persisting them in state, including write-only attributes, versioning, and ephemeral data sources for SSM parameters and random passwords.
Use Terraform data sources to fetch the latest AMI IDs for Amazon Linux and Windows Server by filtering on name and latest, enabling region-agnostic, automated provisioning.
Provision a highly available web cluster in the default VPC with a classic load balancer and security groups. Enable green/blue deployment for zero downtime across two availability zones.
Learn to structure Terraform projects with variables and outputs, using defaults, types, descriptions, and maps to configure regions, tags, and environment-based settings across multiple files.
Explore how to provide Terraform variables at apply using command line options, environment variables, and variable definition files, with staging and production examples.
Learn to use Terraform local variables and local blocks to simplify VPC tagging, build region information with join and merging maps, and apply concise project names.
Explore executing commands locally on the terraformed server with the local-exec provisioner in Terraform, including creating resources, passing environment variables, and sequencing commands as a last-resort option.
Learn to execute remote commands on provisioned resources with inline shell scripts via ssh in Terraform, using remote-exec to run commands on Linux or Windows hosts and verify results.
Discover how to use the Terraform actions block version 1.14+ to automatically invoke a lambda function after create or update, replacing manual local-exec triggers.
Learn to use Terraform lookup and conditional blocks to make infrastructure dynamic, replacing hardcoded values with environment-driven maps, dynamic blocks, and production-only encryption for volumes.
Use Terraform loops with count to provision multiple servers and output their public IPs, while managing index-based names and common pitfalls.
Learn to provision multiple resources with Terraform using for_each loops, convert lists to sets, and apply dynamic blocks and maps to manage resources efficiently.
Learn how to use Terraform for in loops to build lists and maps, generate outputs such as server IPs, and filter user data by name length.
Learn to deploy resources across multiple AWS regions by configuring separate providers with unique aliases, then create region-specific resources and verify them in Europe, Asia, and US.
Configure terraform to provision resources across multiple AWS accounts and regions by using aliased providers and assume roles from a main account, deploying a VPC in dev and production accounts.
Call a reusable VPC module from a folder path, using default values or provided parameters to create staging and production subnets with tags, and print module outputs.
Learn to create and reuse Terraform modules with count and for_each, deploy multi-subnet infrastructure from git sources, and manage outputs and dependencies for scalable, automated provisioning.
Terraform module for multiple AWS accounts and regions enables deploying resources across accounts using provider configurations and data sources.
Welcome to Course: Terraform - From Zero to Certified Professional
Course covering all features of Terraform required to pass HashiCorp Certified Terraform Associate Exam certification exam.
Course is fully bases on building Infrastructure on AWS - Amazon Web Services, but
I have one lesson to show how to work with GCP - Google Cloud Platform and provision VM and simple Web Server.
We also will use AI to write code and find and fix issues in my code.
Course Lessons:
Welcome and Intro
What is Terraform and Why you need it
Installation on Windows
Installation on Linux
Installation on Mac
Upgrade Terraform Version
Installation of Visual Studio Code and Terraform Plugin
AWS Credentials Setup for Terraform
Create Resources on AWS
Update Resources on AWS
Destroy Resources on AWS
Installation and use of Cursor AI Code Editor and Terraform Plugin
Fixing Error for EC2-Classic no new Security Groups can be created without referencing a VPC
Bootstrap simple WebServer
Bootstrap simple WebServer with External Static file
Bootstrap simple WebServer with External Template file
Example Working with Google Cloud Platform, create simple VM and WebServer
Dynamic Blocks
Almost Zero downtime WebServer with Lifecycle and Elastic IP
Manage dependency - depends_on
Show execution results - outputs
Generate, Store, Retrieve Secrets - SSM Parameter Store
Generate, Store, Retrieve Secrets - AWS Secrets Manager
More Secure state file with Ephemeral block
Use Data Sources to fetch information
Use Data Sources to fetch latest AMI id
Deploy Highly Available Web Site with Zero Downtime and Green/Blue Deployment
Variables
Variables with Auto Filling
Local Variables
Execute Local Commands - local-exec
Execute Remote Commands - remote-exec
When and how to use Terraform Actions Block
Lookup and Conditions
Terraform Loops - count
Terraform Loops - for_each
Terraform Loops - for in
Create Resources in Multiply AWS Regions
Create Resources in Multiply AWS Accounts and Regions
Terraform Remote State
Terraform Modules Part-1 - Convert your code into Module
Terraform Modules Part-2 - Use Modules
Terraform Modules Part-3 - Use Modules in loops, store and use Modules in GitHub
Terraform Module for Multiply AWS Accounts and Regions
Best way to recreate resource - terraform taint up to v0.15.1
Best way to recreate resource - terraform apply -replace since v0.15.2
How to manage existing resources - terraform import
How to Import existing resources semi-automatically with v1.5+
Terraform Workspaces and when to use them - terraform workspace
Refactoring Terraform code, manipulation with State - terraform state - Part-1
Refactoring Terraform code, manipulation with State - terraform state - Part-2
Terraform validate, Terraform show, Terraform output, Terraform console, Terraform apply -target
Terraform Logs
Terraform Cloud
Terraform Enterprise
Terraform folders Hierarchy for Dev, Staging, Prod environments
How to use Global Variables
Lock file .terraform.lock.hcl
When to use and how works AWS S3 State Lock File
Review of HashiCorp Certified Associate Exam and how to Register
BONUS - Complex problem solution using Loop inside Loop inside Loop inside Loop
BONUS - Alternative AWS Provider - AWSCC
BONUS - How to Switch or Migrate from Terraform to OpenTofu and back