# rscrafted/aws-infrastructure-baseline architecture

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

- Interactive diagram: https://gitdiagram.com/rscrafted/aws-infrastructure-baseline
- Repository: https://github.com/rscrafted/aws-infrastructure-baseline

## Overview

This Terraform repository provisions a multi-AZ AWS web-service baseline. The operator applies the root configuration, which orchestrates networking, security, load balancing, and a private Auto Scaling fleet; the ALB DNS name is the exported result. The graph reflects relationships documented in the README and project structure; source excerpts were unavailable, so it omits uncertain wiring beyond those documented relationships.

Main entry points: [`main.tf`](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/main.tf) (Root configuration), [`modules/alb/main.tf`](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf) (Application load balancer), [`modules/vpc/main.tf`](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf) (Multi-AZ VPC), [`modules/asg/main.tf`](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf) (Private EC2 instances)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Terraform orchestration"]
  node_root["Root configuration<br/>[main.tf]"]
  node_provider["AWS provider<br/>[provider.tf]"]
  node_endpoint["ALB DNS output<br/>[output.tf]"]
end

subgraph group_networking["Network foundation"]
  node_vpc["Multi-AZ VPC<br/>[main.tf]"]
  node_public["Public subnets<br/>[main.tf]"]
  node_private["Private subnets<br/>[main.tf]"]
  node_igw["Internet gateway<br/>[main.tf]"]
  node_nat["NAT gateway<br/>[main.tf]"]
end

subgraph group_ingress["Ingress and security"]
  node_alb["Application load balancer<br/>[main.tf]"]
  node_target["Target group<br/>[main.tf]"]
  node_listener["HTTP listener<br/>[main.tf]"]
  node_security["Security groups<br/>[main.tf]"]
end

subgraph group_compute["Private compute fleet"]
  node_asg["Auto Scaling Group<br/>[main.tf]"]
  node_launch["Launch template<br/>[main.tf]"]
  node_ami["AL2023 AMI selection<br/>[main.tf]"]
  node_instances["Private EC2 instances<br/>[main.tf]"]
end

node_operator(("Terraform operator"))
node_internet(("Internet clients"))

node_operator -->|"applies"| node_root
node_root -->|"configures provider"| node_provider
node_root -->|"orchestrates"| node_vpc
node_root -->|"orchestrates"| node_security
node_root -->|"orchestrates"| node_alb
node_root -->|"orchestrates"| node_asg
node_root -->|"exports"| node_endpoint
node_vpc -->|"creates"| node_public
node_vpc -->|"creates"| node_private
node_vpc -->|"creates"| node_igw
node_vpc -->|"creates"| node_nat
node_internet -->|"enters network"| node_igw
node_igw -->|"routes traffic"| node_public
node_nat -->|"provides egress"| node_private
node_alb -->|"occupies"| node_public
node_listener -->|"accepts HTTP"| node_alb
node_alb -->|"forwards requests"| node_target
node_alb -->|"uses ALB rules"| node_security
node_security -->|"restricts ingress"| node_instances
node_asg -->|"uses template"| node_launch
node_launch -->|"selects image"| node_ami
node_asg -->|"manages fleet"| node_instances
node_instances -->|"runs within"| node_private
node_target -->|"health-checks"| node_instances
node_endpoint -->|"exports DNS for"| node_alb

click node_root "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/main.tf"
click node_provider "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/provider.tf"
click node_endpoint "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/output.tf"
click node_vpc "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf"
click node_public "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf"
click node_private "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf"
click node_igw "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf"
click node_nat "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf"
click node_alb "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf"
click node_target "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf"
click node_listener "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf"
click node_security "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/security_groups/main.tf"
click node_asg "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf"
click node_launch "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf"
click node_ami "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf"
click node_instances "https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/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_root,node_provider,node_endpoint,node_internet toneBlue
class node_vpc,node_public,node_private,node_igw,node_nat toneAmber
class node_alb,node_target,node_listener,node_security toneMint
class node_asg,node_launch,node_ami,node_instances toneRose
class node_operator toneIndigo
```

## Components

### Terraform orchestration

- [Root configuration](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/main.tf): `main.tf`
- [AWS provider](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/provider.tf): `provider.tf`
- [ALB DNS output](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/output.tf): `output.tf`

### Network foundation

- [Multi-AZ VPC](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`
- [Public subnets](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`
- [Private subnets](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`
- [Internet gateway](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`
- [NAT gateway](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`

### Ingress and security

- [Application load balancer](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf): `modules/alb/main.tf`
- [Target group](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf): `modules/alb/main.tf`
- [HTTP listener](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/alb/main.tf): `modules/alb/main.tf`
- [Security groups](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/security_groups/main.tf): `modules/security_groups/main.tf`

### Private compute fleet

- [Auto Scaling Group](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf): `modules/asg/main.tf`
- [Launch template](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf): `modules/asg/main.tf`
- [AL2023 AMI selection](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf): `modules/asg/main.tf`
- [Private EC2 instances](https://github.com/rscrafted/aws-infrastructure-baseline/blob/main/modules/asg/main.tf): `modules/asg/main.tf`

### Other components

- **Terraform operator**
- **Internet clients**

## Connections

- Terraform operator → Root configuration: applies
- Root configuration → AWS provider: configures provider
- Root configuration → Multi-AZ VPC: orchestrates
- Root configuration → Security groups: orchestrates
- Root configuration → Application load balancer: orchestrates
- Root configuration → Auto Scaling Group: orchestrates
- Root configuration → ALB DNS output: exports
- Multi-AZ VPC → Public subnets: creates
- Multi-AZ VPC → Private subnets: creates
- Multi-AZ VPC → Internet gateway: creates
- Multi-AZ VPC → NAT gateway: creates
- Internet clients → Internet gateway: enters network
- Internet gateway → Public subnets: routes traffic
- NAT gateway → Private subnets: provides egress
- Application load balancer → Public subnets: occupies
- HTTP listener → Application load balancer: accepts HTTP
- Application load balancer → Target group: forwards requests
- Application load balancer → Security groups: uses ALB rules
- Security groups → Private EC2 instances: restricts ingress
- Auto Scaling Group → Launch template: uses template
- Launch template → AL2023 AMI selection: selects image
- Auto Scaling Group → Private EC2 instances: manages fleet
- Private EC2 instances → Private subnets: runs within
- Target group → Private EC2 instances: health-checks
- ALB DNS output → Application load balancer: exports DNS for
