# karamkb2000/wordpress-aws-3tier architecture

> Architecture diagram of the GitHub repository karamkb2000/wordpress-aws-3tier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karamkb2000/wordpress-aws-3tier
- Repository: https://github.com/karamkb2000/wordpress-aws-3tier

## Overview

This repository provisions AWS infrastructure for a WordPress site. The documented flow is public traffic through an Application Load Balancer to EC2 application instances, which access RDS and shared EFS storage; CloudWatch monitors EC2. The Terraform tree identifies the corresponding modules, but source excerpts were unavailable, so module-to-module wiring and configuration-script deployment are not inferred.

Main entry points: [`src/infrastructure/main.tf`](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/main.tf) (Terraform configuration), [`src/infrastructure/modules/ec2/main.tf`](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/ec2/main.tf) (EC2 instances), [`src/infrastructure/modules/load-balancer/main.tf`](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/load-balancer/main.tf) (Application load balancer), [`src/infrastructure/modules/cloud-watch/main.tf`](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/cloud-watch/main.tf) (CloudWatch monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["Terraform provisioning"]
  node_terraform["Terraform configuration<br/>[main.tf]"]
end

subgraph group_network["Network foundation"]
  node_vpc["VPC<br/>[main.tf]"]
  node_subnets["Subnets<br/>[main.tf]"]
  node_internet_gateway["Internet gateway<br/>[main.tf]"]
  node_route_table["Route tables<br/>[main.tf]"]
  node_nat_gateway["NAT gateway<br/>[main.tf]"]
  node_security_groups["Security groups<br/>[main.tf]"]
end

subgraph group_application["Application tier"]
  node_load_balancer["Application load balancer<br/>[main.tf]"]
  node_ec2["EC2 instances<br/>[main.tf]"]
  node_wordpress_setup["WordPress setup"]
  node_lamp_setup["LAMP setup"]
end

subgraph group_data["Data and storage"]
  node_rds[("RDS database<br/>[main.tf]")]
  node_efs["Shared EFS<br/>[main.tf]"]
end

subgraph group_operations["Operations"]
  node_cloudwatch["CloudWatch monitoring<br/>[main.tf]"]
end

node_operator(("Infrastructure operator"))
node_visitor(("Site visitor"))

node_operator -->|"applies configuration"| node_terraform
node_terraform -->|"provisions"| node_vpc
node_terraform -->|"provisions"| node_subnets
node_terraform -->|"provisions"| node_internet_gateway
node_terraform -->|"provisions"| node_route_table
node_terraform -->|"provisions"| node_nat_gateway
node_terraform -->|"provisions"| node_security_groups
node_terraform -->|"provisions"| node_load_balancer
node_terraform -->|"provisions"| node_ec2
node_terraform -->|"provisions"| node_rds
node_terraform -->|"provisions"| node_efs
node_terraform -->|"provisions"| node_cloudwatch
node_visitor -->|"sends requests"| node_load_balancer
node_load_balancer -->|"distributes traffic"| node_ec2
node_ec2 -->|"accesses database"| node_rds
node_ec2 -->|"uses shared files"| node_efs
node_cloudwatch -->|"monitors"| node_ec2

click node_terraform "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/main.tf"
click node_vpc "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/vpc/main.tf"
click node_subnets "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/subnets/main.tf"
click node_internet_gateway "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/internet-gateway/main.tf"
click node_route_table "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/route-table/main.tf"
click node_nat_gateway "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/nat-gateway/main.tf"
click node_security_groups "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/security-groups/main.tf"
click node_load_balancer "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/load-balancer/main.tf"
click node_ec2 "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/ec2/main.tf"
click node_wordpress_setup "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/config/install_wordpress.sh"
click node_lamp_setup "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/config/install_lamp_stack.sh"
click node_rds "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/database/main.tf"
click node_efs "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/efs/main.tf"
click node_cloudwatch "https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/cloud-watch/main.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_terraform toneBlue
class node_vpc,node_subnets,node_internet_gateway,node_route_table,node_nat_gateway,node_security_groups toneAmber
class node_load_balancer,node_ec2,node_wordpress_setup,node_lamp_setup toneMint
class node_rds,node_efs toneRose
class node_cloudwatch,node_operator,node_visitor toneIndigo
```

## Components

### Terraform provisioning

- [Terraform configuration](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/main.tf): `src/infrastructure/main.tf`

### Network foundation

- [VPC](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/vpc/main.tf): `src/infrastructure/modules/vpc/main.tf`
- [Subnets](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/subnets/main.tf): `src/infrastructure/modules/subnets/main.tf`
- [Internet gateway](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/internet-gateway/main.tf): `src/infrastructure/modules/internet-gateway/main.tf`
- [Route tables](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/route-table/main.tf): `src/infrastructure/modules/route-table/main.tf`
- [NAT gateway](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/nat-gateway/main.tf): `src/infrastructure/modules/nat-gateway/main.tf`
- [Security groups](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/security-groups/main.tf): `src/infrastructure/modules/security-groups/main.tf`

### Application tier

- [Application load balancer](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/load-balancer/main.tf): `src/infrastructure/modules/load-balancer/main.tf`
- [EC2 instances](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/ec2/main.tf): `src/infrastructure/modules/ec2/main.tf`
- [WordPress setup](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/config/install_wordpress.sh): `src/config/install_wordpress.sh`
- [LAMP setup](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/config/install_lamp_stack.sh): `src/config/install_lamp_stack.sh`

### Data and storage

- [RDS database](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/database/main.tf): `src/infrastructure/modules/database/main.tf`
- [Shared EFS](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/efs/main.tf): `src/infrastructure/modules/efs/main.tf`

### Operations

- [CloudWatch monitoring](https://github.com/karamkb2000/wordpress-aws-3tier/blob/main/src/infrastructure/modules/cloud-watch/main.tf): `src/infrastructure/modules/cloud-watch/main.tf`

### Other components

- **Infrastructure operator**
- **Site visitor**

## Connections

- Infrastructure operator → Terraform configuration: applies configuration
- Terraform configuration → VPC: provisions
- Terraform configuration → Subnets: provisions
- Terraform configuration → Internet gateway: provisions
- Terraform configuration → Route tables: provisions
- Terraform configuration → NAT gateway: provisions
- Terraform configuration → Security groups: provisions
- Terraform configuration → Application load balancer: provisions
- Terraform configuration → EC2 instances: provisions
- Terraform configuration → RDS database: provisions
- Terraform configuration → Shared EFS: provisions
- Terraform configuration → CloudWatch monitoring: provisions
- Site visitor → Application load balancer: sends requests
- Application load balancer → EC2 instances: distributes traffic
- EC2 instances → RDS database: accesses database
- EC2 instances → Shared EFS: uses shared files
- CloudWatch monitoring → EC2 instances: monitors
