# jamesesc/aws-secure-network-infrastructure architecture

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

- Interactive diagram: https://gitdiagram.com/jamesesc/aws-secure-network-infrastructure
- Repository: https://github.com/jamesesc/aws-secure-network-infrastructure

## Overview

This repository provisions a secure AWS network with Terraform. The documented workflow is to initialize and apply the bootstrap configuration, then apply the infrastructure, and finally connect through a bastion to a private EC2 instance. The README also highlights least-privilege security groups, remote state, and user-managed KMS encryption. No Terraform source excerpts were provided, so relationships below are limited to capabilities and deployment steps stated in the README.

Main entry points: [`infrastructure/main.tf`](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/main.tf) (Infrastructure config), [`infrastructure/modules/compute/main.tf`](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/compute/main.tf) (Bastion host), [`bootstrap/main.tf`](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/bootstrap/main.tf) (Bootstrap config), [`infrastructure/modules/networking/main.tf`](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/networking/main.tf) (Private VPC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["Provisioning"]
  node_bootstrap["Bootstrap config<br/>[main.tf]"]
  node_infrastructure["Infrastructure config<br/>[main.tf]"]
end

subgraph group_state["State and encryption"]
  node_remote_state[("Remote state<br/>[main.tf]")]
  node_kms["Managed KMS key<br/>[main.tf]"]
end

subgraph group_network["Network security"]
  node_vpc["Private VPC<br/>[main.tf]"]
  node_security_groups["Least-privilege groups<br/>[main.tf]"]
end

subgraph group_access["Compute access"]
  node_bastion["Bastion host<br/>[main.tf]"]
  node_private_ec2["Private EC2<br/>[main.tf]"]
end

node_operator(("Operator"))
node_authorized_source(("Authorized SSH source"))

node_operator -->|"applies first"| node_bootstrap
node_operator -->|"applies next"| node_infrastructure
node_bootstrap -.->|"sets up"| node_remote_state
node_infrastructure -->|"provisions"| node_vpc
node_infrastructure -->|"provisions"| node_security_groups
node_infrastructure -->|"provisions"| node_bastion
node_infrastructure -->|"provisions"| node_private_ec2
node_authorized_source -->|"SSH connects"| node_bastion
node_bastion -->|"SSH hops"| node_private_ec2

click node_bootstrap "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/bootstrap/main.tf"
click node_infrastructure "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/main.tf"
click node_remote_state "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/bootstrap/main.tf"
click node_kms "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/storage/main.tf"
click node_vpc "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/networking/main.tf"
click node_security_groups "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/networking/main.tf"
click node_bastion "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/compute/main.tf"
click node_private_ec2 "https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/compute/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_bootstrap,node_infrastructure toneBlue
class node_remote_state,node_kms toneAmber
class node_vpc,node_security_groups toneMint
class node_bastion,node_private_ec2 toneRose
class node_operator,node_authorized_source toneIndigo
```

## Components

### Provisioning

- [Bootstrap config](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [Infrastructure config](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/main.tf): `infrastructure/main.tf`

### State and encryption

- [Remote state](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [Managed KMS key](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/storage/main.tf): `infrastructure/modules/storage/main.tf`

### Network security

- [Private VPC](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/networking/main.tf): `infrastructure/modules/networking/main.tf`
- [Least-privilege groups](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/networking/main.tf): `infrastructure/modules/networking/main.tf`

### Compute access

- [Bastion host](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/compute/main.tf): `infrastructure/modules/compute/main.tf`
- [Private EC2](https://github.com/jamesesc/aws-secure-network-infrastructure/blob/main/infrastructure/modules/compute/main.tf): `infrastructure/modules/compute/main.tf`

### Other components

- **Operator**
- **Authorized SSH source**

## Connections

- Operator → Bootstrap config: applies first (evidence: `README.md`)
- Operator → Infrastructure config: applies next (evidence: `README.md`)
- Bootstrap config → Remote state: sets up
- Infrastructure config → Private VPC: provisions (evidence: `README.md`)
- Infrastructure config → Least-privilege groups: provisions (evidence: `README.md`)
- Infrastructure config → Bastion host: provisions (evidence: `README.md`)
- Infrastructure config → Private EC2: provisions (evidence: `README.md`)
- Authorized SSH source → Bastion host: SSH connects (evidence: `README.md`)
- Bastion host → Private EC2: SSH hops (evidence: `README.md`)
