# pravesh-sudha/python-for-devops architecture

> Architecture diagram of the GitHub repository pravesh-sudha/python-for-devops, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pravesh-sudha/python-for-devops
- Repository: https://github.com/pravesh-sudha/python-for-devops

## Overview

The repository combines an AWS resource-management CLI with a separate Cognee knowledge-graph demo (a Flask web app and an async command-line example). The AWS workflow routes CLI actions to service-specific managers that call AWS APIs. The web workflow accepts content and a query, resets and processes Cognee data, then returns search results and a graph visualization. Edges reflect the provided source excerpts or README; the Cognee library’s internal stages and storage are not shown.

Main entry points: [`automate-ec2-s3-and-lambda/main.py`](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/main.py) (Command Router), [`cognee-flask/app.py`](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/app.py) (Flask Routes), [`automate-ec2-s3-and-lambda/lambda_manager.py`](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/lambda_manager.py) (Lambda Manager), [`cognee-flask/templates/index.html`](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/templates/index.html) (Content Form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_aws_cli["AWS CLI"]
  node_aws_cli_main["Command Router<br/>[main.py]"]
end

subgraph group_aws_resources["AWS Resources"]
  node_ec2_manager["EC2 Manager<br/>[ec2_manager.py]"]
  node_s3_manager["S3 Manager<br/>[s3_manager.py]"]
  node_lambda_manager["Lambda Manager<br/>[lambda_manager.py]"]
  node_ec2_service["Amazon EC2"]
  node_s3_service[("Amazon S3")]
  node_lambda_service["AWS Lambda"]
  node_iam_service["AWS IAM"]
end

subgraph group_cognee_web["Cognee Web"]
  node_browser_form["Content Form<br/>[index.html]"]
  node_form_script["Form Validation<br/>[scripts.js]"]
  node_flask_app["Flask Routes<br/>[app.py]"]
  node_results_view["Results View<br/>[results.html]"]
  node_graph_output["Graph Visualization"]
end

subgraph group_cognee_processing["Cognee Processing"]
  node_cognee_engine["Cognee Engine"]
  node_cognee_cli["Async Demo<br/>[main.py]"]
end

node_aws_user(("CLI User"))
node_web_user(("Web User"))

node_aws_user -->|"runs commands"| node_aws_cli_main
node_aws_cli_main -->|"routes EC2 actions"| node_ec2_manager
node_aws_cli_main -->|"routes S3 actions"| node_s3_manager
node_aws_cli_main -->|"routes Lambda actions"| node_lambda_manager
node_ec2_manager -->|"manages instances"| node_ec2_service
node_s3_manager -->|"manages buckets"| node_s3_service
node_lambda_manager -->|"manages functions"| node_lambda_service
node_lambda_manager -->|"gets or creates roles"| node_iam_service
node_web_user -->|"submits content"| node_browser_form
node_form_script -->|"validates submission"| node_browser_form
node_browser_form -.->|"posts form"| node_flask_app
node_flask_app -->|"resets, processes, searches"| node_cognee_engine
node_flask_app -->|"writes visualization"| node_graph_output
node_flask_app -->|"renders search results"| node_results_view
node_cognee_cli -->|"resets, processes, searches"| node_cognee_engine

click node_aws_cli_main "https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/main.py"
click node_ec2_manager "https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/ec2_manager.py"
click node_s3_manager "https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/s3_manager.py"
click node_lambda_manager "https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/lambda_manager.py"
click node_browser_form "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/templates/index.html"
click node_form_script "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/static/js/scripts.js"
click node_flask_app "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/app.py"
click node_results_view "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/templates/results.html"
click node_graph_output "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/static/graph_visualization.html"
click node_cognee_cli "https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/main.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_aws_cli_main,node_aws_user,node_web_user toneBlue
class node_ec2_manager,node_s3_manager,node_lambda_manager,node_ec2_service,node_s3_service,node_lambda_service,node_iam_service toneAmber
class node_browser_form,node_form_script,node_flask_app,node_results_view,node_graph_output toneMint
class node_cognee_engine,node_cognee_cli toneRose
```

## Components

### AWS CLI

- [Command Router](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/main.py): `automate-ec2-s3-and-lambda/main.py`

### AWS Resources

- [EC2 Manager](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/ec2_manager.py): `automate-ec2-s3-and-lambda/ec2_manager.py`
- [S3 Manager](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/s3_manager.py): `automate-ec2-s3-and-lambda/s3_manager.py`
- [Lambda Manager](https://github.com/pravesh-sudha/python-for-devops/blob/main/automate-ec2-s3-and-lambda/lambda_manager.py): `automate-ec2-s3-and-lambda/lambda_manager.py`
- **Amazon EC2**
- **Amazon S3**
- **AWS Lambda**
- **AWS IAM**

### Cognee Web

- [Content Form](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/templates/index.html): `cognee-flask/templates/index.html`
- [Form Validation](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/static/js/scripts.js): `cognee-flask/static/js/scripts.js`
- [Flask Routes](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/app.py): `cognee-flask/app.py`
- [Results View](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/templates/results.html): `cognee-flask/templates/results.html`
- [Graph Visualization](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/static/graph_visualization.html): `cognee-flask/static/graph_visualization.html`

### Cognee Processing

- **Cognee Engine**
- [Async Demo](https://github.com/pravesh-sudha/python-for-devops/blob/main/cognee-flask/main.py): `cognee-flask/main.py`

### Other components

- **CLI User**
- **Web User**

## Connections

- CLI User → Command Router: runs commands (evidence: `README.md`)
- Command Router → EC2 Manager: routes EC2 actions (evidence: `automate-ec2-s3-and-lambda/main.py`)
- Command Router → S3 Manager: routes S3 actions (evidence: `automate-ec2-s3-and-lambda/main.py`)
- Command Router → Lambda Manager: routes Lambda actions (evidence: `automate-ec2-s3-and-lambda/main.py`)
- EC2 Manager → Amazon EC2: manages instances (evidence: `automate-ec2-s3-and-lambda/ec2_manager.py`)
- S3 Manager → Amazon S3: manages buckets (evidence: `automate-ec2-s3-and-lambda/s3_manager.py`)
- Lambda Manager → AWS Lambda: manages functions (evidence: `automate-ec2-s3-and-lambda/lambda_manager.py`)
- Lambda Manager → AWS IAM: gets or creates roles (evidence: `automate-ec2-s3-and-lambda/lambda_manager.py`)
- Web User → Content Form: submits content
- Form Validation → Content Form: validates submission (evidence: `cognee-flask/static/js/scripts.js`)
- Content Form → Flask Routes: posts form
- Flask Routes → Cognee Engine: resets, processes, searches (evidence: `cognee-flask/app.py`)
- Flask Routes → Graph Visualization: writes visualization (evidence: `cognee-flask/app.py`)
- Flask Routes → Results View: renders search results (evidence: `cognee-flask/app.py`)
- Async Demo → Cognee Engine: resets, processes, searches (evidence: `cognee-flask/main.py`)
