How aws-samples/aws-refarch-wordpress works
What this project is (type + purpose)
This repo is not an “application codebase” in the classic sense; it’s an AWS Reference Architecture implemented as AWS CloudFormation YAML templates to deploy a high-availability, scalable WordPress stack on AWS.
Key indicators:
• templates/aws-refarch-wordpress-master-newvpc.yaml and many aws-refarch-wordpress-0x-*.yaml files → nested CloudFormation stacks orchestrated from a master template.
• README enumerates AWS resources: VPC/subnets/NAT/IGW, ALB, Auto Scaling Groups, EC2, RDS Aurora, EFS, ElastiCache (optional), CloudFront/Route53 (optional), ACM, CloudWatch dashboard/alarms, SNS notifications, bastion.
• bits/ contains artifacts used at instance boot/config time (e.g., OPcache status PHP, ElastiCache client tarball).
How to read the file tree into architecture
• templates/ = the authoritative architecture definition (CloudFormation).
• aws-refarch-wordpress-master-newvpc.yaml (and “master” variants) = orchestration / composition.
• aws-refarch-wordpress-01-newvpc.yaml = networking foundation (VPC, subnets, routing, NAT, IGW).
• aws-refarch-wordpress-02-securitygroups.yaml = security boundaries and allowed flows.
• aws-refarch-wordpress-03-* = core service layers (bastion, EFS, alarms, ElastiCache, ALB, RDS).
• aws-refarch-wordpress-04-* = edge + web tier (CloudFront, web ASG/EC2).
• aws-refarch-wordpress-05-route53.yaml = DNS.
• aws-refarch-wordpress-06-dashboard.yaml = observability.
• samples/ = example parameters and “how to launch” scripts—useful to understand optional toggles (CloudFront/Route53/ElastiCache, etc.).
• bits/ = runtime configuration payloads placed onto instances (OPcache status page, php.ini overrides sample referenced via S3 URL, etc.).
What
Master template as the root and each nested template as a child stack with clear responsibility boundaries.
Recommended nodes:
• Master Stack: aws-refarch-wordpress-master-newvpc.yaml
• 01 Networking: VPC, public/web/data subnets across 2–6 AZs, route tables, IGW, NAT GW(s)
• 02 Security Groups: ALB SG, Web SG, DB SG, EFS SG, Bastion SG, etc.
• 03 Bastion
• 03 EFS File System
• 03 EFS Alarms (+ SNS notifications, autoscaling “threshold adjuster” instance)
• 03 RDS Aurora
• 03 ElastiCache (optional)
• 03 Public ALB
• 04 Web Tier
• 04 CloudFront (optional)
• 05 Route53 (optional)
• 06 CloudWatch Dashboard
Why this matters: this repo’s architecture *is* the CloudFormation composition.
Include:
• Client (Browser)
• Route 53 (optional) → CloudFront (optional) → ALB (public subnets)
• ALB → Web Auto Scaling Group (EC2 in private web subnets)
• Web EC2 runtime dependencies:
• EFS (private data subnets) mounted by web instances for shared WordPress content (e.g., wp-content)
• RDS Aurora (private data subnets) for WordPress database
• ElastiCache Memcached (optional) for object/page/db caching via plugin (W3 Total Cache)
• OPcache on each instance (local, per-node) + optional status page
• Outbound path from web instances to the internet via NAT Gateway (for OS updates, package downloads, WordPress/plugin updates, S3 access for offload, etc.)
• Bastion Host (public subnet) for SSH access into private instances
• HTTPS: Client → (Route53) → (CloudFront) → ALB
• HTTP/HTTPS: ALB → Web EC2
• NFS: Web EC2 ↔ EFS
• MySQL: Web EC2 ↔ Aurora
• Memcached: Web EC2 ↔ ElastiCache
• SSH: Admin → Bastion → Web EC2
• Egress: Web EC2 → NAT GW → Internet/AWS APIs
This repo is explicit about:
• public subnets: ALB, NAT GW, bastion
• private web subnets: WordPress EC2 in ASG
• private data subnets: RDS, EFS mount targets, ElastiCache
To be accurate:
• ALB spans public subnets in multiple AZs
• Web ASG has instances across private web subnets in multiple AZs
• EFS has mount targets per AZ (in data subnets)
• Aurora is multi-AZ (cluster depiction)
• NAT GW(s) in public subnets (README implies across public subnets)
• route tables at least conceptually:
• Public subnets route to IGW
• Private subnets route to NAT for egress
Relationships / interactions to highlight (project-specific)
1. Shared filesystem is a first-class design choice: Web instances are stateless-ish; EFS centralizes WordPress files so autoscaling doesn’t lose uploads/themes/plugins.
Compute is horizontally scalable: Web tier is an Auto Scaling Group behind an ALB.
3. Data tier is managed: Aurora for DB, EFS for file store, ElastiCache optional.
4. Optional edge acceleration: CloudFront (optionally with ACM cert in us-east-1) sits in front; Route53 optionally points at it or ALB.
5. Operational maturity: CloudWatch dashboard + EFS burst credit alarms + SNS notifications + special “threshold adjuster” automation via an EC2/ASG mechanism.
6. Admin access pattern: Bastion is present but “desired=0 by default” and can be enabled when needed.
Top: Client → Route53 → CloudFront (optional)
• Public subnets: ALB, NAT GW, Bastion
• Private web subnets: Web ASG instances
• Private data subnets: Aurora, ElastiCache, EFS mount targets
Bottom: CloudFormation master stack → nested stacks (small inset or side panel)
This yields a single page that is both “ops-accurate” and “design-communicative.”