IaC - Infrastructure as Code
IaC

IaC — Infrastructure as Code

Collection of Infrastructure as Code projects with Terraform

1 WordPress Website deployed by IaC — Terraform

The objective of this project is to provision and deploy a new WordPress website using Infrastructure as Code (IaC) with Terraform, creating containerized WordPress workloads on Amazon EC2. The solution then includes migrating content from an existing WordPress site. This Terraform project is developed in a local environment and used to deploy the infrastructure to AWS Cloud.

Application Architecture and Tools

The new website is deployed using IaC with Terraform, following the modular architecture described below:

  • (1) VPC
  • (2) public subnets in two different Availability Zones
  • (1) EC2 host, which dynamically creates containers via a docker-compose.yml file for:
    — DATABASE: MySQL (wordpress_db) – container: database, port 3306 (internal)
    — FRONTEND: PHP – WordPress application (wordpress_app) – container: wordpress, port 80 (internal)
  • (2) Security Groups for the EC2 instance and the Application Load Balancer (ALB)
  • (1) Application Load Balancer (ALB)
  • (1) Route 53 A record for the custom domain
  • (1) CloudFront distribution (CDN) to provide caching for the application
  • (1) ACM SSL certificate for the custom domain
  • Optional: WordPress content migration by importing a backup file (.wpress extension) from the previous site

Final Implementation

  1. Final AWS infrastructure deployment with Terraform
  2. Content WordPress Migration at new Website

Finally, the new WordPress website, migrated under an IaC-deployed infrastructure using Terraform, was successfully implemented!

github.com/connyval/2025_TF_SiteWP

Graphical Technical Design

WordPress Website deployed by IAC-TERRAFORM
IaCTerraformDockerEC2 ALBCloudFrontRoute53ACMWordPress
Diciembre 2025
Back to Portfolio