This project is a Terraform-based proof of concept for migrating a simple WordPress blog from on-premises infrastructure to AWS.
The goal is to validate whether AWS can run WordPress with higher availability and lower operational burden, then remove all resources after evaluation.
- Deploy a highly available WordPress infrastructure on AWS.
- Support roughly 1,000 daily visitors.
- Estimate monthly infrastructure costs.
The infrastructure maps WordPress requirements (PHP app + MySQL DB + shared file storage) to these AWS services:
-
Application Load Balancer (ALB)
- Distributes HTTP/HTTPS traffic across EC2 instances.
- Performs health checks and stops routing to unhealthy targets.
- Highly available by default.
-
Amazon EC2
- Runs Linux virtual machines hosting Apache, PHP, and WordPress.
- Minimum of 2 instances for high availability.
-
Amazon RDS for MySQL
- Managed MySQL database for WordPress data.
- Supports backups, patching, and optional Multi-AZ for higher availability.
-
Amazon EFS
- Shared NFSv4.1 file system for WordPress files and user uploads.
- Accessible by multiple EC2 instances.
-
Security Groups
- Restrict traffic between ALB, EC2, RDS, and EFS.
- Principle of least privilege (only required ports/protocols).
Target uptime: 99.99%.
High-level strategy:
- Place at least two EC2 instances behind an ALB.
- Use health checks for automatic failover at the load balancer layer.
- Use managed database and shared filesystem services.
Current provider configuration:
- Terraform CLI:
>= 1.6.0 - AWS provider:
hashicorp/aws ~> 6.34.0 - Default region variable:
eu-west-2
Estimate costs before finalizing:
- Run a Terraform plan and list all resources.
- Use AWS Pricing Calculator for selected region and sizes.
- Record assumptions (instance class, RDS size, storage, data transfer).