← ProjectsTerraform · AWS

Automating a WordPress infrastructure deployment

A reproducible AWS environment provisioned with Terraform, covering networking, routing, security and compute.

TerraformAWSVPCEC2Linux
01 — Overview

What I built.

The project replaced a manual AWS setup with a repeatable Terraform configuration that creates the network and compute needed to reach the WordPress setup page. The configuration provisions the VPC, public subnet, Internet Gateway, routing, security group and Ubuntu EC2 instance, then uses user data to bootstrap Apache, PHP and WordPress.

TerraformInfrastructure provisioning
10.0.0.0/16VPC address space
EC2Ubuntu application host
User dataAutomated WordPress bootstrap
02 — Architecture

How the platform fits together.

Architecture & provisioning flow

Infrastructure architecture

Switch between the request path and the Terraform provisioning path.

03 — Implementation

How it was implemented.

  1. 01Defined a VPC using the 10.0.0.0/16 address space and a public subnet at 10.0.1.0/24.
  2. 02Attached an Internet Gateway and configured a route for outbound internet access.
  3. 03Created security-group rules for HTTP and administrative access used by the learning environment.
  4. 04Provisioned an Ubuntu EC2 instance and used user data to install Apache, PHP and WordPress.
  5. 05Verified the deployment by reaching the WordPress setup page from the browser.
terraform · aws
04 — Troubleshooting

Issues resolved.

01Networking

Public connectivity depended on several linked resources

ProblemThe instance could not simply be placed in a subnet and expected to become reachable.

FixWorked through how the route table, Internet Gateway, public subnet and security group combine to create the public network path.

02Bootstrap

Manual configuration was not repeatable

ProblemInstalling the web stack manually would make the deployment dependent on post-provisioning steps.

FixMoved Apache, PHP and WordPress installation into EC2 user data so the instance could bootstrap automatically.

03Scope

Learning architecture was not production architecture

ProblemA single public EC2 instance is useful for learning but does not represent a resilient production WordPress design.

FixKept the implemented scope clear and separated future production controls into explicit next-step considerations.

Outcome.

Terraform was able to provision the environment consistently and the WordPress setup page became reachable after the EC2 instance completed its automated bootstrap.