# osza99/terraform-aws-infra-demo architecture

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

- Interactive diagram: https://gitdiagram.com/osza99/terraform-aws-infra-demo
- Repository: https://github.com/osza99/terraform-aws-infra-demo

## Overview

This repository describes a Terraform-managed AWS demo. Its principal workflow provisions a VPC with a public subnet and internet routing, restricts SSH access to the operator’s IP, and creates a public EC2 instance with a configuration script. The README also mentions S3 bucket and backend/state-locking work, but says the bucket was manually deleted and its file is no longer needed; those capabilities are therefore shown as documented legacy state, not as confirmed active resources. Source excerpts were unavailable, so relationships below rely only on README statements.

Main entry points: [`vpc.tf`](https://github.com/osza99/terraform-aws-infra-demo/blob/main/vpc.tf) (VPC and subnet), [`security.tf`](https://github.com/osza99/terraform-aws-infra-demo/blob/main/security.tf) (SSH security group), [`compute.tf`](https://github.com/osza99/terraform-aws-infra-demo/blob/main/compute.tf) (Public EC2 instance), [`script.sh`](https://github.com/osza99/terraform-aws-infra-demo/blob/main/script.sh) (Instance configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_network["Network"]
  node_vpc["VPC and subnet<br/>[vpc.tf]"]
  node_internet_routing["Internet gateway and routes<br/>[vpc.tf]"]
end

subgraph group_compute["Compute and access"]
  node_ssh_security["SSH security group<br/>[security.tf]"]
  node_ec2["Public EC2 instance<br/>[compute.tf]"]
  node_configuration["Instance configuration<br/>[script.sh]"]
end

subgraph group_state["State and provider"]
  node_aws_provider["AWS provider<br/>[providers.tf]"]
  node_s3_state[("S3 bucket and backend<br/>[README.md]")]
end

node_operator(("Infrastructure operator"))

node_operator -->|"provisions"| node_vpc
node_operator -->|"configures"| node_internet_routing
node_operator -->|"creates"| node_ssh_security
node_operator -->|"creates"| node_ec2
node_operator -->|"configures"| node_configuration
node_operator -.->|"documented setup"| node_s3_state

click node_aws_provider "https://github.com/osza99/terraform-aws-infra-demo/blob/main/providers.tf"
click node_vpc "https://github.com/osza99/terraform-aws-infra-demo/blob/main/vpc.tf"
click node_internet_routing "https://github.com/osza99/terraform-aws-infra-demo/blob/main/vpc.tf"
click node_ssh_security "https://github.com/osza99/terraform-aws-infra-demo/blob/main/security.tf"
click node_ec2 "https://github.com/osza99/terraform-aws-infra-demo/blob/main/compute.tf"
click node_configuration "https://github.com/osza99/terraform-aws-infra-demo/blob/main/script.sh"
click node_s3_state "https://github.com/osza99/terraform-aws-infra-demo/blob/main/README.md"

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_vpc,node_internet_routing toneBlue
class node_ssh_security,node_ec2,node_configuration toneAmber
class node_aws_provider,node_s3_state toneMint
class node_operator toneIndigo
```

## Components

### Network

- [VPC and subnet](https://github.com/osza99/terraform-aws-infra-demo/blob/main/vpc.tf): `vpc.tf`
- [Internet gateway and routes](https://github.com/osza99/terraform-aws-infra-demo/blob/main/vpc.tf): `vpc.tf`

### Compute and access

- [SSH security group](https://github.com/osza99/terraform-aws-infra-demo/blob/main/security.tf): `security.tf`
- [Public EC2 instance](https://github.com/osza99/terraform-aws-infra-demo/blob/main/compute.tf): `compute.tf`
- [Instance configuration](https://github.com/osza99/terraform-aws-infra-demo/blob/main/script.sh): `script.sh`

### State and provider

- [AWS provider](https://github.com/osza99/terraform-aws-infra-demo/blob/main/providers.tf): `providers.tf`
- [S3 bucket and backend](https://github.com/osza99/terraform-aws-infra-demo/blob/main/README.md): `README.md`

### Other components

- **Infrastructure operator**

## Connections

- Infrastructure operator → VPC and subnet: provisions (evidence: `README.md`)
- Infrastructure operator → Internet gateway and routes: configures (evidence: `README.md`)
- Infrastructure operator → SSH security group: creates (evidence: `README.md`)
- Infrastructure operator → Public EC2 instance: creates (evidence: `README.md`)
- Infrastructure operator → Instance configuration: configures (evidence: `README.md`)
- Infrastructure operator → S3 bucket and backend: documented setup (evidence: `README.md`)
