# mohamedelkhameshamdi/terraform-cloud architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedelkhameshamdi/terraform-cloud
- Repository: https://github.com/mohamedelkhameshamdi/terraform-cloud

## Overview

This repository provisions a modular AWS web-application infrastructure across dev, test, and prod environments. The workflow is environment configuration → Terraform-managed network and security foundations → public load balancing and private compute → private database and S3 asset configuration. The README documents these capabilities and their key relationships; no source excerpts were provided, so the graph stays at documented module and infrastructure boundaries.

Main entry points: [`environments/dev/main.tf`](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/environments/dev/main.tf) (Environment configuration), [`modules/compute/main.tf`](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/compute/main.tf) (Private auto scaling), [`modules/network/main.tf`](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/network/main.tf) (VPC and subnets), [`modules/security/main.tf`](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/security/main.tf) (Security groups)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Environment deployment"]
  node_env["Environment configuration<br/>[main.tf]"]
end

subgraph group_foundation["Network and security"]
  node_network["VPC and subnets<br/>[main.tf]"]
  node_security["Security groups<br/>[main.tf]"]
end

subgraph group_application["Application tier"]
  node_alb["Public load balancer<br/>[main.tf]"]
  node_compute["Private auto scaling<br/>[main.tf]"]
  node_instances["Application instances<br/>[main.tf]"]
end

subgraph group_data["Data and assets"]
  node_database[("Private MySQL database<br/>[main.tf]")]
  node_storage["Assets bucket configuration<br/>[main.tf]"]
  node_assets[("Manually created assets bucket")]
end

node_operator(("Infrastructure operator"))
node_aws["AWS infrastructure"]

node_operator -->|"runs Terraform"| node_env
node_env -->|"provisions environments"| node_aws
node_env -->|"configures"| node_network
node_env -->|"configures"| node_security
node_env -->|"configures"| node_alb
node_env -->|"configures"| node_compute
node_env -->|"configures"| node_database
node_env -->|"configures"| node_storage
node_network -->|"hosts publicly"| node_alb
node_network -->|"hosts privately"| node_compute
node_network -->|"isolates privately"| node_database
node_alb -->|"forwards traffic"| node_compute
node_compute -->|"scales"| node_instances
node_security -->|"secures"| node_alb
node_security -->|"secures"| node_compute
node_security -->|"secures"| node_database
node_storage -->|"configures"| node_assets

click node_env "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/environments/dev/main.tf"
click node_network "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/network/main.tf"
click node_security "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/security/main.tf"
click node_alb "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/load-balancer/main.tf"
click node_compute "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/compute/main.tf"
click node_instances "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/compute/main.tf"
click node_database "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/database/main.tf"
click node_storage "https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/storage/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_env toneBlue
class node_network,node_security toneAmber
class node_alb,node_compute,node_instances toneMint
class node_database,node_storage,node_assets toneRose
class node_operator,node_aws toneIndigo
```

## Components

### Environment deployment

- [Environment configuration](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/environments/dev/main.tf): `environments/dev/main.tf`

### Network and security

- [VPC and subnets](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/network/main.tf): `modules/network/main.tf`
- [Security groups](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/security/main.tf): `modules/security/main.tf`

### Application tier

- [Public load balancer](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/load-balancer/main.tf): `modules/load-balancer/main.tf`
- [Private auto scaling](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/compute/main.tf): `modules/compute/main.tf`
- [Application instances](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/compute/main.tf): `modules/compute/main.tf`

### Data and assets

- [Private MySQL database](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/database/main.tf): `modules/database/main.tf`
- [Assets bucket configuration](https://github.com/mohamedelkhameshamdi/terraform-cloud/blob/main/modules/storage/main.tf): `modules/storage/main.tf`
- **Manually created assets bucket**

### Other components

- **Infrastructure operator**
- **AWS infrastructure**

## Connections

- Infrastructure operator → Environment configuration: runs Terraform (evidence: `README.md`)
- Environment configuration → AWS infrastructure: provisions environments (evidence: `README.md`)
- Environment configuration → VPC and subnets: configures (evidence: `README.md`)
- Environment configuration → Security groups: configures (evidence: `README.md`)
- Environment configuration → Public load balancer: configures (evidence: `README.md`)
- Environment configuration → Private auto scaling: configures (evidence: `README.md`)
- Environment configuration → Private MySQL database: configures (evidence: `README.md`)
- Environment configuration → Assets bucket configuration: configures (evidence: `README.md`)
- VPC and subnets → Public load balancer: hosts publicly (evidence: `README.md`)
- VPC and subnets → Private auto scaling: hosts privately (evidence: `README.md`)
- VPC and subnets → Private MySQL database: isolates privately (evidence: `README.md`)
- Public load balancer → Private auto scaling: forwards traffic (evidence: `README.md`)
- Private auto scaling → Application instances: scales (evidence: `README.md`)
- Security groups → Public load balancer: secures (evidence: `README.md`)
- Security groups → Private auto scaling: secures (evidence: `README.md`)
- Security groups → Private MySQL database: secures (evidence: `README.md`)
- Assets bucket configuration → Manually created assets bucket: configures (evidence: `README.md`)
