# mohitbnt/cloudsystem-monolith architecture

> Architecture diagram of the GitHub repository mohitbnt/cloudsystem-monolith, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohitbnt/cloudsystem-monolith
- Repository: https://github.com/mohitbnt/cloudsystem-monolith

## Overview

CloudSystem is infrastructure-as-code for deploying a horizontally scalable WordPress application on AWS. The principal workflow builds a Golden AMI, deploys environment-specific infrastructure, then bootstraps private EC2 instances with runtime configuration and—when needed—imports a database dump before WordPress becomes ready. Its major stages include networking, compute, persistent storage, caching, DNS/TLS, and secure configuration. The README documents these relationships; no source excerpts were provided, so edges are based on README statements rather than inspected implementation calls.

Main entry points: [`terraform/main.tf`](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/main.tf) (Terraform deployment), [`terraform/modules/compute/autoscalinggroup.tf`](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/autoscalinggroup.tf) (EC2 autoscaling), [`terraform/modules/compute/templates/user-data.tftpl`](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/templates/user-data.tftpl) (Instance bootstrap), [`terraform/modules/database/main.tf`](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/database/main.tf) (RDS MariaDB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_image["Image build"]
  node_packer["AMI builder"]
  node_goldenami["Golden AMI"]
end

subgraph group_platform["AWS platform"]
  node_terraform["Terraform deployment<br/>[main.tf]"]
  node_network["VPC networking<br/>[main.tf]"]
  node_security["IAM and security<br/>[iam.tf]"]
  node_compute["EC2 autoscaling"]
  node_loadbalancer["Load balancer<br/>[loadbalancer.tf]"]
  node_dns["DNS and TLS<br/>[main.tf]"]
  node_cloudflare["Cloudflare DNS"]
  node_aws["AWS services"]
end

subgraph group_runtime["Instance runtime"]
  node_parameters[("Runtime parameters<br/>[main.tf]")]
  node_bootstrap["Instance bootstrap<br/>[user-data.tftpl]"]
  node_wordpress["WordPress runtime"]
end

subgraph group_state["Application state"]
  node_storage[("S3 storage<br/>[main.tf]")]
  node_database[("RDS MariaDB<br/>[main.tf]")]
  node_cache[("Redis cache<br/>[main.tf]")]
end

node_internet(("Internet"))

node_packer -->|"builds"| node_goldenami
node_terraform -->|"provisions"| node_network
node_terraform -->|"provisions"| node_security
node_terraform -->|"provisions"| node_compute
node_terraform -->|"provisions"| node_loadbalancer
node_terraform -->|"provisions"| node_dns
node_terraform -->|"provisions"| node_storage
node_terraform -->|"provisions"| node_database
node_terraform -->|"provisions"| node_cache
node_terraform -->|"provisions"| node_parameters
node_compute -->|"uses image"| node_goldenami
node_internet -->|"requests DNS"| node_cloudflare
node_cloudflare -->|"resolves to"| node_loadbalancer
node_internet -->|"sends HTTP/S"| node_loadbalancer
node_loadbalancer -->|"forwards HTTP"| node_compute
node_compute -->|"runs at boot"| node_bootstrap
node_bootstrap -->|"reads settings"| node_parameters
node_bootstrap -->|"reads secret"| node_database
node_bootstrap -->|"downloads dump"| node_storage
node_bootstrap -->|"imports dump"| node_database
node_bootstrap -->|"configures"| node_wordpress
node_compute -->|"connects"| node_database
node_compute -->|"connects"| node_cache
node_wordpress -->|"stores uploads"| node_storage
node_wordpress -->|"uses object cache"| node_cache
node_network -->|"hosts privately"| node_compute
node_network -->|"hosts privately"| node_database
node_network -->|"hosts privately"| node_cache
node_terraform -->|"deploys resources"| node_aws

click node_packer "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl"
click node_goldenami "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl"
click node_terraform "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/main.tf"
click node_network "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/networking/main.tf"
click node_security "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/security/iam.tf"
click node_compute "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/autoscalinggroup.tf"
click node_loadbalancer "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/loadbalancer.tf"
click node_dns "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/dns-and-ssl/main.tf"
click node_storage "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/storage/main.tf"
click node_database "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/database/main.tf"
click node_cache "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/cache/main.tf"
click node_parameters "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/parameters/main.tf"
click node_bootstrap "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/templates/user-data.tftpl"
click node_wordpress "https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl"

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_packer,node_goldenami toneBlue
class node_terraform,node_network,node_security,node_compute,node_loadbalancer,node_dns,node_cloudflare,node_aws toneAmber
class node_parameters,node_bootstrap,node_wordpress toneMint
class node_storage,node_database,node_cache toneRose
class node_internet toneIndigo
```

## Components

### Image build

- [AMI builder](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl): `packer/wordpress.ubuntu.pkr.hcl`
- [Golden AMI](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl): `packer/wordpress.ubuntu.pkr.hcl`

### AWS platform

- [Terraform deployment](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/main.tf): `terraform/main.tf`
- [VPC networking](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/networking/main.tf): `terraform/modules/networking/main.tf`
- [IAM and security](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/security/iam.tf): `terraform/modules/security/iam.tf`
- [EC2 autoscaling](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/autoscalinggroup.tf): `terraform/modules/compute/autoscalinggroup.tf`
- [Load balancer](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/loadbalancer.tf): `terraform/modules/compute/loadbalancer.tf`
- [DNS and TLS](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/dns-and-ssl/main.tf): `terraform/modules/dns-and-ssl/main.tf`
- **Cloudflare DNS**
- **AWS services**

### Instance runtime

- [Runtime parameters](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/parameters/main.tf): `terraform/modules/parameters/main.tf`
- [Instance bootstrap](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/compute/templates/user-data.tftpl): `terraform/modules/compute/templates/user-data.tftpl`
- [WordPress runtime](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/packer/wordpress.ubuntu.pkr.hcl): `packer/wordpress.ubuntu.pkr.hcl`

### Application state

- [S3 storage](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/storage/main.tf): `terraform/modules/storage/main.tf`
- [RDS MariaDB](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/database/main.tf): `terraform/modules/database/main.tf`
- [Redis cache](https://github.com/mohitbnt/cloudsystem-monolith/blob/main/terraform/modules/cache/main.tf): `terraform/modules/cache/main.tf`

### Other components

- **Internet**

## Connections

- AMI builder → Golden AMI: builds (evidence: `README.md`)
- Terraform deployment → VPC networking: provisions (evidence: `README.md`)
- Terraform deployment → IAM and security: provisions (evidence: `README.md`)
- Terraform deployment → EC2 autoscaling: provisions (evidence: `README.md`)
- Terraform deployment → Load balancer: provisions (evidence: `README.md`)
- Terraform deployment → DNS and TLS: provisions (evidence: `README.md`)
- Terraform deployment → S3 storage: provisions (evidence: `README.md`)
- Terraform deployment → RDS MariaDB: provisions (evidence: `README.md`)
- Terraform deployment → Redis cache: provisions (evidence: `README.md`)
- Terraform deployment → Runtime parameters: provisions (evidence: `README.md`)
- EC2 autoscaling → Golden AMI: uses image (evidence: `README.md`)
- Internet → Cloudflare DNS: requests DNS (evidence: `README.md`)
- Cloudflare DNS → Load balancer: resolves to (evidence: `README.md`)
- Internet → Load balancer: sends HTTP/S (evidence: `README.md`)
- Load balancer → EC2 autoscaling: forwards HTTP (evidence: `README.md`)
- EC2 autoscaling → Instance bootstrap: runs at boot (evidence: `README.md`)
- Instance bootstrap → Runtime parameters: reads settings (evidence: `README.md`)
- Instance bootstrap → RDS MariaDB: reads secret (evidence: `README.md`)
- Instance bootstrap → S3 storage: downloads dump (evidence: `README.md`)
- Instance bootstrap → RDS MariaDB: imports dump (evidence: `README.md`)
- Instance bootstrap → WordPress runtime: configures (evidence: `README.md`)
- EC2 autoscaling → RDS MariaDB: connects (evidence: `README.md`)
- EC2 autoscaling → Redis cache: connects (evidence: `README.md`)
- WordPress runtime → S3 storage: stores uploads (evidence: `README.md`)
- WordPress runtime → Redis cache: uses object cache (evidence: `README.md`)
- VPC networking → EC2 autoscaling: hosts privately (evidence: `README.md`)
- VPC networking → RDS MariaDB: hosts privately (evidence: `README.md`)
- VPC networking → Redis cache: hosts privately (evidence: `README.md`)
- Terraform deployment → AWS services: deploys resources (evidence: `README.md`)
