This project showcases how to use Terraform to provision and manage AWS infrastructure through an automated, reusable IaC approach. As part of an AWS workshop, the deployment focuses on building a scalable WordPress application integrated with EC2, VPC, IAM, S3, and a MySQL database via RDS. The exercise highlights best practices in cloud architecture, security, and modular configuration using Terraform.
- Master Terraform fundamentals: providers, resources, state files, and variables
- Provision infrastructure via modular configurations
- Create IAM roles and policies following least-privilege principles
- Set up networking layers with VPC, subnets, route tables, NATs, and internet gateways
- Secure EC2 instance traffic using security groups
- Host WordPress static assets in S3
- Configure Amazon RDS for MySQL database hosting
- Generate Terraform outputs for key application components
- Validate successful WordPress deployment
- Inspect and interpret Terraform state files for infrastructure drift and consistency
Tool | Description |
---|---|
Terraform | Core infrastructure automation tool |
AWS EC2 | WordPress hosting via virtual machines |
AWS VPC | Virtual network isolation and traffic segmentation |
AWS IAM | Role-based access and permission management |
AWS S3 | Static asset storage and hosting |
Amazon RDS | Managed MySQL database service |
Amazon EFS | Shared storage for EC2 instances |
Amazon SSM | Systems management for infrastructure and software |
AWS Secrets Manager | Secure credentials and database password storage |
Amazon ACM | Certificate provisioning for secure HTTP (HTTPS) |
Amazon CloudFront | CDN integration for fast WordPress delivery |
terraform-wordpress/
βββ main.tf
βββ variables.tf
βββ outputs.tf
βββ userdata/
β βββ staging-efs.sh
β βββ staging-wordpress.sh
βββ README.md

# Clone the project repository
git clone https://github.com/yourusername/terraform-wordpress.git
cd terraform-wordpress
# Initialize Terraform modules
terraform init
# Preview infrastructure changes
terraform plan
# Apply infrastructure deployment
terraform apply
π‘ Note: Ensure your AWS CLI is configured and your credentials have appropriate IAM permissions. This demo used administrative access for provisioning.
- Strengthened understanding of AWS infrastructure via modular Terraform scripting
- Practiced secure networking through VPC subnets, NAT gateways, and security groups
- Created IAM profiles for scoped EC2 and S3 access
- Automated provisioning of WordPress infrastructure
- Applied best practices in state file inspection and resource validation



This project is licensed under the MIT License.