A hands-on learning repository for Terraform infrastructure-as-code, cloud provisioning, and automation with AWS, Azure, GCP, and Ansible.
This repository contains step-by-step Terraform labs and examples demonstrating:
- Terraform basics and syntax
- Terraform providers and resources
- AWS EC2, security groups, and AMI management
- Azure VM, networking, and resource provisioning
- Google Cloud Platform compute and networking
- Terraform state management and workspaces
- Ansible automation for WordPress and Jenkins deployment
- Infrastructure as Code (IaC)
- Terraform modules, variables, and outputs
- AWS Amazon Linux 2 AMI selection
- Secure AWS security group configuration
- Azure resource group, network, and VM deployment
- GCP VPC, subnet, firewall, and compute instance setup
- Terraform remote state and workspaces
- Provisioners and lifecycle rules
01-Infrastructure-as-Code-IaC-Basics/02-Terraform-Basics/03-Terraform-Fundamental-Blocks/04-Terraform-Resources/05-Terraform-Variables/06-Terraform-Datasources/07-Terraform-State/08-Terraform-Workspaces/09-Terraform-Provisioners/10-Terraform-Modules/13-Terraform-State-Import/14-Terraform-Graph/15-Terraform-Expressions/16-Terraform-Debug/lab-00/- AWS EC2 example with Amazon Linux 2 and secure networkinglab-01/- Jenkins deployment with Terraform and Ansiblelab-04/- WordPress deployment using Terraform and Ansible roles
- Install Terraform CLI and required cloud CLI tools.
- Change into the lab directory you want to run.
- Initialize Terraform:
cd lab-04
terraform init- Review the plan:
terraform plan- Apply the configuration:
terraform apply- After deployment, locate the output values or the provisioned public IP address.
The WordPress lab uses Terraform provisioning together with Ansible roles to install and configure WordPress on a cloud VM.
cd lab-04
terraform init
terraform plan
terraform apply- Keep Terraform state secure and out of version control.
- Use
.gitignoreto exclude.tfstate,.terraform, and sensitive files. - Use data sources for the latest cloud image IDs.
- Limit SSH access to trusted IP addresses.
- Tag resources and use descriptive variable names.
This repository is designed for learning and demonstration purposes. Customize variables and provider settings before running in production.