# mohammed-005/terraform-capstone architecture

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

- Interactive diagram: https://gitdiagram.com/mohammed-005/terraform-capstone
- Repository: https://github.com/mohammed-005/terraform-capstone

## Overview

This repository provisions an AWS web server with Terraform. The principal workflow is to apply the infrastructure configuration, which uses network and compute modules to create the public-facing deployment; Terraform reports the EC2 public IP for users to visit. A separate backend configuration provisions S3-backed state, documented with locking, versioning, and encryption. Source excerpts were not provided, so relationships below rely on the README; implementation details beyond those statements are omitted.

Main entry points: [`infrastructure/main.tf`](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/main.tf) (Infrastructure config), [`infrastructure/modules/compute/main.tf`](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/compute/main.tf) (EC2 and Apache), [`infrastructure/modules/network`](https://github.com/mohammed-005/terraform-capstone/tree/main/infrastructure/modules/network) (Network module), [`infrastructure/modules/network/main.tf`](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/network/main.tf) (VPC and public network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Terraform deployment"]
  node_infra["Infrastructure config<br/>[main.tf]"]
  node_outputs["Deployment outputs<br/>[outputs.tf]"]
end

subgraph group_networking["AWS networking"]
  node_network["Network module"]
  node_network_resources["VPC and public network<br/>[main.tf]"]
end

subgraph group_compute["Web server"]
  node_compute["Compute module"]
  node_webserver["EC2 and Apache<br/>[main.tf]"]
end

subgraph group_state["Terraform state"]
  node_backend["Backend config<br/>[main.tf]"]
  node_s3state[("S3 Terraform state<br/>[backend.tf]")]
end

node_operator(("Terraform operator"))
node_visitor(("Web visitor"))

node_operator -->|"applies"| node_infra
node_infra -->|"uses module"| node_network
node_infra -->|"uses module"| node_compute
node_network -->|"creates"| node_network_resources
node_compute -->|"creates"| node_webserver
node_network_resources -->|"provides subnet"| node_webserver
node_infra -->|"reports IP"| node_outputs
node_operator -->|"applies"| node_backend
node_backend -->|"configures state"| node_s3state
node_visitor -->|"opens public IP"| node_webserver

click node_infra "https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/main.tf"
click node_outputs "https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/outputs.tf"
click node_network "https://github.com/mohammed-005/terraform-capstone/tree/main/infrastructure/modules/network"
click node_network_resources "https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/network/main.tf"
click node_compute "https://github.com/mohammed-005/terraform-capstone/tree/main/infrastructure/modules/compute"
click node_webserver "https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/compute/main.tf"
click node_backend "https://github.com/mohammed-005/terraform-capstone/blob/main/backend/main.tf"
click node_s3state "https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/backend.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_infra,node_outputs toneBlue
class node_network,node_network_resources toneAmber
class node_compute,node_webserver toneMint
class node_backend,node_s3state toneRose
class node_operator,node_visitor toneIndigo
```

## Components

### Terraform deployment

- [Infrastructure config](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/main.tf): `infrastructure/main.tf`
- [Deployment outputs](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/outputs.tf): `infrastructure/outputs.tf`

### AWS networking

- [Network module](https://github.com/mohammed-005/terraform-capstone/tree/main/infrastructure/modules/network): `infrastructure/modules/network`
- [VPC and public network](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/network/main.tf): `infrastructure/modules/network/main.tf`

### Web server

- [Compute module](https://github.com/mohammed-005/terraform-capstone/tree/main/infrastructure/modules/compute): `infrastructure/modules/compute`
- [EC2 and Apache](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/modules/compute/main.tf): `infrastructure/modules/compute/main.tf`

### Terraform state

- [Backend config](https://github.com/mohammed-005/terraform-capstone/blob/main/backend/main.tf): `backend/main.tf`
- [S3 Terraform state](https://github.com/mohammed-005/terraform-capstone/blob/main/infrastructure/backend.tf): `infrastructure/backend.tf`

### Other components

- **Terraform operator**
- **Web visitor**

## Connections

- Terraform operator → Infrastructure config: applies (evidence: `README.md`)
- Infrastructure config → Network module: uses module (evidence: `README.md`)
- Infrastructure config → Compute module: uses module (evidence: `README.md`)
- Network module → VPC and public network: creates (evidence: `README.md`)
- Compute module → EC2 and Apache: creates (evidence: `README.md`)
- VPC and public network → EC2 and Apache: provides subnet (evidence: `README.md`)
- Infrastructure config → Deployment outputs: reports IP (evidence: `README.md`)
- Terraform operator → Backend config: applies (evidence: `README.md`)
- Backend config → S3 Terraform state: configures state (evidence: `README.md`)
- Web visitor → EC2 and Apache: opens public IP (evidence: `README.md`)
