# yogananth-r/aws-cloud-inventory architecture

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

- Interactive diagram: https://gitdiagram.com/yogananth-r/aws-cloud-inventory
- Repository: https://github.com/yogananth-r/aws-cloud-inventory

## Overview

AWS Cloud Inventory is a CloudShell-oriented CLI that collects regional EC2 instance and EBS volume inventory and writes both datasets to a formatted Excel workbook. The main workflow is CLI invocation → collectors → report sheets → saved workbook; AWS identity and service access are supplied through the Boto3 session helper. README capabilities and sampled source support this scope; no broader inventory stages are implemented in the available tree.

Main entry points: [`cli.py`](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/cli.py) (Export command), [`collectors/ec2.py`](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ec2.py) (EC2 collector), [`collectors/ebs.py`](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ebs.py) (EBS collector), [`exporter/excel.py`](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/exporter/excel.py) (Excel exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI workflow"]
  node_cli["Export command<br/>[cli.py]"]
  node_config["Defaults and report path<br/>[config.py]"]
end

subgraph group_collect["Inventory collection"]
  node_ec2["EC2 collector<br/>[ec2.py]"]
  node_ebs["EBS collector<br/>[ebs.py]"]
  node_tags["Name tag helper<br/>[tags.py]"]
end

subgraph group_report["Excel reporting"]
  node_excel["Excel exporter<br/>[excel.py]"]
end

subgraph group_access["AWS access"]
  node_session["AWS session<br/>[session.py]"]
end

node_operator(("CloudShell user"))
node_aws[("AWS EC2 API")]
node_workbook["XLSX report"]

node_operator -->|"runs"| node_cli
node_cli -->|"reads defaults"| node_config
node_cli -->|"collects EC2"| node_ec2
node_cli -->|"collects EBS"| node_ebs
node_cli -->|"writes sheets"| node_excel
node_ec2 -->|"gets name"| node_tags
node_ec2 -->|"creates client"| node_session
node_ebs -->|"creates client"| node_session
node_session -->|"creates EC2 client"| node_aws
node_ec2 -->|"describes instances"| node_aws
node_ebs -->|"describes volumes"| node_aws
node_excel -->|"reads report path"| node_config
node_excel -->|"saves workbook"| node_workbook

click node_cli "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/cli.py"
click node_ec2 "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ec2.py"
click node_ebs "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ebs.py"
click node_tags "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/utils/tags.py"
click node_excel "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/exporter/excel.py"
click node_config "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/config.py"
click node_session "https://github.com/yogananth-r/aws-cloud-inventory/blob/main/utils/session.py"

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_cli,node_config,node_operator toneBlue
class node_ec2,node_ebs,node_tags,node_aws toneAmber
class node_excel toneMint
class node_session toneRose
class node_workbook toneIndigo
```

## Components

### CLI workflow

- [Export command](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/cli.py): `cli.py`
- [Defaults and report path](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/config.py): `config.py`

### Inventory collection

- [EC2 collector](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ec2.py): `collectors/ec2.py`
- [EBS collector](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/collectors/ebs.py): `collectors/ebs.py`
- [Name tag helper](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/utils/tags.py): `utils/tags.py`

### Excel reporting

- [Excel exporter](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/exporter/excel.py): `exporter/excel.py`

### AWS access

- [AWS session](https://github.com/yogananth-r/aws-cloud-inventory/blob/main/utils/session.py): `utils/session.py`

### Other components

- **CloudShell user**
- **AWS EC2 API**
- **XLSX report**

## Connections

- CloudShell user → Export command: runs
- Export command → Defaults and report path: reads defaults
- Export command → EC2 collector: collects EC2
- Export command → EBS collector: collects EBS
- Export command → Excel exporter: writes sheets
- EC2 collector → Name tag helper: gets name
- EC2 collector → AWS session: creates client
- EBS collector → AWS session: creates client
- AWS session → AWS EC2 API: creates EC2 client
- EC2 collector → AWS EC2 API: describes instances
- EBS collector → AWS EC2 API: describes volumes
- Excel exporter → Defaults and report path: reads report path
- Excel exporter → XLSX report: saves workbook
