# patilaryan96/aws-infrastructure-automation architecture

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

- Interactive diagram: https://gitdiagram.com/patilaryan96/aws-infrastructure-automation
- Repository: https://github.com/patilaryan96/aws-infrastructure-automation

## Overview

This repository is a Terraform configuration for provisioning a public AWS web server. The operator runs Terraform; its configuration selects the AWS region and inputs, declares networking and compute resources, stores state in S3, and exposes the instance’s public IP. The README documents these relationships, but no Terraform source excerpts were provided, so the graph reflects documented behavior only.

Main entry points: [`terraform/main.tf`](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf) (EC2 Instance), [`terraform/provider.tf`](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/provider.tf) (AWS Provider), [`terraform/variables.tf`](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/variables.tf) (Deployment Variables), [`terraform/backend.tf`](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/backend.tf) (S3 Backend Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Terraform Configuration"]
  node_provider["AWS Provider<br/>[provider.tf]"]
  node_variables["Deployment Variables<br/>[variables.tf]"]
end

subgraph group_network["Public Networking"]
  node_vpc["VPC<br/>[main.tf]"]
  node_subnet["Public Subnet<br/>[main.tf]"]
  node_gateway["Internet Gateway<br/>[main.tf]"]
  node_routes["Route Table<br/>[main.tf]"]
  node_security["Security Group<br/>[main.tf]"]
end

subgraph group_workload["Web Workload"]
  node_instance["EC2 Instance<br/>[main.tf]"]
  node_apache["Apache Setup<br/>[main.tf]"]
  node_outputs["Instance Outputs<br/>[outputs.tf]"]
end

subgraph group_state["Remote State"]
  node_backend["S3 Backend Config<br/>[backend.tf]"]
end

node_operator(("Operator"))
node_terraform["Terraform CLI"]
node_s3[("S3 State Bucket")]

node_operator -->|"runs commands"| node_terraform
node_terraform -->|"uses config"| node_provider
node_provider -->|"sets region"| node_variables
node_terraform -->|"provisions"| node_vpc
node_variables -->|"configures CIDR"| node_vpc
node_vpc -->|"contains"| node_subnet
node_vpc -->|"attaches"| node_gateway
node_subnet -->|"associates"| node_routes
node_routes -->|"routes through"| node_gateway
node_terraform -->|"provisions"| node_security
node_terraform -->|"launches"| node_instance
node_subnet -->|"hosts"| node_instance
node_security -->|"allows traffic"| node_instance
node_instance -->|"runs user data"| node_apache
node_outputs -->|"reads public IP"| node_instance
node_terraform -->|"initializes state"| node_backend
node_backend -->|"stores state"| node_s3

click node_provider "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/provider.tf"
click node_variables "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/variables.tf"
click node_vpc "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_subnet "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_gateway "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_routes "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_security "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_instance "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_apache "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf"
click node_outputs "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/outputs.tf"
click node_backend "https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/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_provider,node_variables toneBlue
class node_vpc,node_subnet,node_gateway,node_routes,node_security,node_s3 toneAmber
class node_instance,node_apache,node_outputs toneMint
class node_backend toneRose
class node_operator,node_terraform toneIndigo
```

## Components

### Terraform Configuration

- [AWS Provider](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/provider.tf): `terraform/provider.tf`
- [Deployment Variables](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/variables.tf): `terraform/variables.tf`

### Public Networking

- [VPC](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Public Subnet](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Internet Gateway](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Route Table](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Security Group](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`

### Web Workload

- [EC2 Instance](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Apache Setup](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [Instance Outputs](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/outputs.tf): `terraform/outputs.tf`

### Remote State

- [S3 Backend Config](https://github.com/patilaryan96/aws-infrastructure-automation/blob/main/terraform/backend.tf): `terraform/backend.tf`

### Other components

- **Operator**
- **Terraform CLI**
- **S3 State Bucket**

## Connections

- Operator → Terraform CLI: runs commands (evidence: `README.md`)
- Terraform CLI → AWS Provider: uses config (evidence: `README.md`)
- AWS Provider → Deployment Variables: sets region (evidence: `README.md`)
- Terraform CLI → VPC: provisions (evidence: `README.md`)
- Deployment Variables → VPC: configures CIDR (evidence: `README.md`)
- VPC → Public Subnet: contains (evidence: `README.md`)
- VPC → Internet Gateway: attaches (evidence: `README.md`)
- Public Subnet → Route Table: associates (evidence: `README.md`)
- Route Table → Internet Gateway: routes through (evidence: `README.md`)
- Terraform CLI → Security Group: provisions (evidence: `README.md`)
- Terraform CLI → EC2 Instance: launches (evidence: `README.md`)
- Public Subnet → EC2 Instance: hosts (evidence: `README.md`)
- Security Group → EC2 Instance: allows traffic (evidence: `README.md`)
- EC2 Instance → Apache Setup: runs user data (evidence: `README.md`)
- Instance Outputs → EC2 Instance: reads public IP (evidence: `README.md`)
- Terraform CLI → S3 Backend Config: initializes state (evidence: `README.md`)
- S3 Backend Config → S3 State Bucket: stores state (evidence: `README.md`)
