# jbalajiavm/boto3-aws architecture

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

- Interactive diagram: https://gitdiagram.com/jbalajiavm/boto3-aws
- Repository: https://github.com/jbalajiavm/boto3-aws

## Overview

#### Repository Role
This is a learning repository for a “100 Days of DevOps” curriculum, not a single deployable application. It contains independent AWS, Terraform, Python, Bash, Kubernetes, Docker, and CI/CD examples. The root `README.md` is the curriculum index; most directories are standalone execution units.

#### Entry Points and Execution Model
There is no central runtime or orchestrator. Engineers run artifacts directly according to their technology:
- Terraform roots are applied independently, e.g. `main.tf`, `two-tier-environment/main.tf`, and `aws-lambda/lambda.tf`.
- Python automation scripts are invoked directly, e.g. `aws-lambda/lambda.py` and `boto3/ec2_instance.py`.
- Kubernetes resources are applied with `kubectl`, e.g. `argocd_demo/yamls/deployment.yaml`.
- Jenkins workflows are executed by Jenkins from `docker_jenkins/Jenkinsfile` or `jenkins-terraform-pipeline/ec2_pipeline/Jenkinsfile`.

#### AWS Infrastructure Provisioning
Terraform is the primary infrastructure-as-code boundary. Small examples provision individual AWS capabilities—S3, KMS, networking, CloudTrail, Lambda, and monitoring—while each directory owns its own state/configuration assumptions.
- Base or standalone stacks: `main.tf`, `cloudtrail.tf`, `aws_config/main.tf`.
- Network and storage examples: `nat_gateway/main.tf`, `s3-crossregion-replication/main.tf`, `vpc_flow_logs/main.tf`.
- Encryption and policy boundaries: `kms/main.tf`, `s3_kms/main.tf`, `iam_policies/1-1-allow-access-to-EC2-S3.json`.

#### Two-Tier AWS Reference Composition
`two-tier-environment/` is the clearest multi-component architecture. Its root Terraform configuration composes modules for VPC networking, EC2 compute, load balancing, Auto Scaling, MySQL RDS, and SNS notifications.
- Composition root: `two-tier-environment/main.tf`, `two-tier-environment/variables.tf`.
- Network-to-compute flow: `two-tier-environment/vpc_networking/main.tf` supplies infrastructure consumed by `two-tier-environment/ec2_instance/main.tf` and `two-tier-environment/auto-scaling/main.tf`.
- Request/data path: Application Load Balancer → EC2/Auto Scaling workload → RDS MySQL, represented by `two-tier-environment/application_load_balancer/outputs.tf`, `two-tier-environment/rds_mysql/main.tf`, and `two-tier-environment/ec2_instance/userdata.tpl`.
- Notification output is isolated in `two-tier-environment/sns/main.tf`.

#### Event-Driven and Programmatic AWS Automation
Python scripts use AWS SDK/Boto3 and Lambda handlers to operate AWS resources at runtime. IAM trust and permission documents form the security boundary between function execution and EC2 operations.
- Lambda deployment/handler examples: `aws-lambda/lambda.py`, `aws-lambda/ec2_stop_start_instances_updated/lambda.py`, `aws-lambda/ec2_stop_start_instances_updated/main.tf`.
- EC2 lifecycle and inventory scripts: `boto3/ec2_instance.py`, `boto3/ec2_information/retrieve_information_about_ec2.py`.
- Cleanup automation targets AMIs, EBS volumes, and snapshots: `boto3/cleanup_old_ami/cleanup_old_ami.py`, `boto3/cleaning_old_ebs_vol/cleaning_old_ebs_vol.py`, `boto3/snapshot_cleanup/snapshot_cleanup.py`.
- External service boundary: AWS APIs for EC2, S3, IAM, Lambda, CloudWatch, SNS, and related services; credentials are expected from the local/AWS execution environment.

#### Delivery and Container Platforms
The repository demonstrates multiple separate delivery paths rather than one standardized pipeline.
- Jenkins can build/deploy containerized workloads or run Terraform: `docker_jenkins/Dockerfile`, `docker_jenkins/Jenkinsfile`, `jenkins-terraform-pipeline/ec2_pipeline/main.tf`.
- An EKS-oriented example packages a simple static app into a container and deploys it from manifests: `eks-codepipeline/Dockerfile`, `eks-codepipeline/buildspec.yml`, `eks-codepipeline/manifests/deployment.yaml`.
- Kubernetes/cluster configuration examples are independent: `argocd_demo/yamls/service.yaml`, `kind/multi-node-master.yaml`, `metallb/cm.yaml`.

#### Operational Utilities and Observability
Operational scripts provide local or AWS-facing diagnostics rather than a shared monitoring service. Log parsing, host-performance checks, Kubernetes debugging, and notification examples are standalone tools.
- Apache log parsing: `apache_log_parser.py`, `apache_log_parsing/apache_log_parsing_v4.py`.
- Host and service diagnostics: `performance_tuning/performance-monitoring.py`, `python_script_to_check_website_status/script_to_check_website_status.py`.
- Kubernetes failure investigation: `kubernetes_debugging/kubernetes_debugging_select.sh`, `kubernetes_debugging/crash_loopback_error.sh`.
- AWS alerting infrastructure: `monitoring_and_alerting/sns_alert/main.tf`, `s3eventstosns.tf`.

Main entry points: [`two-tier-environment/main.tf`](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/main.tf) (Two-tier composition), [`README.md`](https://github.com/jbalajiavm/boto3-aws/blob/main/README.md) (Curriculum index), [`two-tier-environment/ec2_instance/main.tf`](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/ec2_instance/main.tf) (EC2 & Auto Scaling), [`main.tf`](https://github.com/jbalajiavm/boto3-aws/blob/main/main.tf) (Standalone Terraform)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_iac["Infrastructure as Code"]
  node_terraform_roots["Standalone Terraform<br/>Terraform roots<br/>[main.tf]"]
  node_security_iac["Security policies<br/>Terraform and IAM<br/>[main.tf]"]
  node_network_storage_iac["Network &amp; storage<br/>Terraform examples<br/>[main.tf]"]
end

subgraph group_two_tier["Two-Tier Reference"]
  node_two_tier_root["Two-tier composition<br/>Terraform root<br/>[main.tf]"]
  node_vpc["VPC networking<br/>Terraform module<br/>[main.tf]"]
  node_alb["Application Load Balancer<br/>Terraform module<br/>[outputs.tf]"]
  node_compute["EC2 &amp; Auto Scaling<br/>Terraform modules<br/>[main.tf]"]
  node_rds[("RDS MySQL<br/>Terraform module<br/>[main.tf]")]
  node_sns["SNS notifications<br/>Terraform module<br/>[main.tf]"]
end

subgraph group_automation["AWS Automation"]
  node_lambda{{"Lambda automation<br/>Python handler + Terraform<br/>[lambda.py]"}}
  node_boto3_scripts["Boto3 scripts<br/>Python automation<br/>[ec2_instance.py]"]
  node_aws_apis(("AWS APIs<br/>cloud service boundary"))
end

subgraph group_delivery["Delivery &amp; Clusters"]
  node_jenkins["Jenkins workflows<br/>CI pipelines"]
  node_container_delivery["EKS app delivery<br/>container build and manifests<br/>[buildspec.yml]"]
  node_kubernetes["Kubernetes examples<br/>manifests and cluster config<br/>[deployment.yaml]"]
end

subgraph group_operations["Operational Utilities"]
  node_diagnostics["Diagnostics scripts<br/>Python and Bash tools"]
  node_alerting["AWS alerting<br/>Terraform examples<br/>[main.tf]"]
end

node_curriculum["Curriculum index<br/>repository guide<br/>[README.md]"]

node_curriculum -->|"indexes"| node_terraform_roots
node_curriculum -->|"indexes"| node_two_tier_root
node_curriculum -->|"indexes"| node_lambda
node_curriculum -->|"indexes"| node_jenkins
node_terraform_roots -->|"provisions"| node_aws_apis
node_security_iac -->|"configures access"| node_aws_apis
node_network_storage_iac -->|"provisions"| node_aws_apis
node_two_tier_root -->|"composes"| node_vpc
node_two_tier_root -->|"composes"| node_alb
node_two_tier_root -->|"composes"| node_compute
node_two_tier_root -->|"composes"| node_rds
node_two_tier_root -->|"composes"| node_sns
node_vpc -->|"network for"| node_compute
node_alb -->|"routes requests"| node_compute
node_compute -->|"uses MySQL"| node_rds
node_lambda -->|"operates"| node_aws_apis
node_boto3_scripts -->|"operates"| node_aws_apis
node_jenkins -.->|"builds or deploys"| node_container_delivery
node_container_delivery -->|"deploys manifests"| node_kubernetes
node_diagnostics -.->|"troubleshoots"| node_kubernetes
node_alerting -->|"creates notifications"| node_aws_apis

click node_curriculum "https://github.com/jbalajiavm/boto3-aws/blob/main/README.md"
click node_terraform_roots "https://github.com/jbalajiavm/boto3-aws/blob/main/main.tf"
click node_security_iac "https://github.com/jbalajiavm/boto3-aws/blob/main/kms/main.tf"
click node_network_storage_iac "https://github.com/jbalajiavm/boto3-aws/blob/main/nat_gateway/main.tf"
click node_two_tier_root "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/main.tf"
click node_vpc "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/vpc_networking/main.tf"
click node_alb "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/application_load_balancer/outputs.tf"
click node_compute "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/ec2_instance/main.tf"
click node_rds "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/rds_mysql/main.tf"
click node_sns "https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/sns/main.tf"
click node_lambda "https://github.com/jbalajiavm/boto3-aws/blob/main/aws-lambda/ec2_stop_start_instances_updated/lambda.py"
click node_boto3_scripts "https://github.com/jbalajiavm/boto3-aws/blob/main/boto3/ec2_instance.py"
click node_jenkins "https://github.com/jbalajiavm/boto3-aws/blob/main/docker_jenkins/Jenkinsfile"
click node_container_delivery "https://github.com/jbalajiavm/boto3-aws/blob/main/eks-codepipeline/buildspec.yml"
click node_kubernetes "https://github.com/jbalajiavm/boto3-aws/blob/main/argocd_demo/yamls/deployment.yaml"
click node_diagnostics "https://github.com/jbalajiavm/boto3-aws/blob/main/performance_tuning/performance-monitoring.py"
click node_alerting "https://github.com/jbalajiavm/boto3-aws/blob/main/monitoring_and_alerting/sns_alert/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_terraform_roots,node_security_iac,node_network_storage_iac toneBlue
class node_two_tier_root,node_vpc,node_alb,node_compute,node_rds,node_sns toneAmber
class node_lambda,node_boto3_scripts,node_aws_apis toneMint
class node_jenkins,node_container_delivery,node_kubernetes toneRose
class node_diagnostics,node_alerting toneIndigo
class node_curriculum toneNeutral
```

## Components

### Infrastructure as Code

Independent Terraform roots and modules.

- [Standalone Terraform](https://github.com/jbalajiavm/boto3-aws/blob/main/main.tf): Terraform roots · Provisions isolated AWS capabilities. · `main.tf`
- [Security policies](https://github.com/jbalajiavm/boto3-aws/blob/main/kms/main.tf): Terraform and IAM · Encryption and access-control examples. · `kms/main.tf`
- [Network & storage](https://github.com/jbalajiavm/boto3-aws/blob/main/nat_gateway/main.tf): Terraform examples · NAT, replication, and flow-log examples. · `nat_gateway/main.tf`

### Two-Tier Reference

Composable AWS application environment.

- [Two-tier composition](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/main.tf): Terraform root · Composes application infrastructure modules. · `two-tier-environment/main.tf`
- [VPC networking](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/vpc_networking/main.tf): Terraform module · `two-tier-environment/vpc_networking/main.tf`
- [Application Load Balancer](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/application_load_balancer/outputs.tf): Terraform module · `two-tier-environment/application_load_balancer/outputs.tf`
- [EC2 & Auto Scaling](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/ec2_instance/main.tf): Terraform modules · Application workload and scaling capacity. · `two-tier-environment/ec2_instance/main.tf`
- [RDS MySQL](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/rds_mysql/main.tf): Terraform module · `two-tier-environment/rds_mysql/main.tf`
- [SNS notifications](https://github.com/jbalajiavm/boto3-aws/blob/main/two-tier-environment/sns/main.tf): Terraform module · `two-tier-environment/sns/main.tf`

### AWS Automation

Direct Python and Lambda examples.

- [Lambda automation](https://github.com/jbalajiavm/boto3-aws/blob/main/aws-lambda/ec2_stop_start_instances_updated/lambda.py): Python handler + Terraform · Event-driven EC2 lifecycle example. · `aws-lambda/ec2_stop_start_instances_updated/lambda.py`
- [Boto3 scripts](https://github.com/jbalajiavm/boto3-aws/blob/main/boto3/ec2_instance.py): Python automation · Direct EC2 inventory and lifecycle operations. · `boto3/ec2_instance.py`
- **AWS APIs**: cloud service boundary · Credentials come from the local or AWS execution environment.

### Delivery & Clusters

Separate CI/CD and Kubernetes examples.

- [Jenkins workflows](https://github.com/jbalajiavm/boto3-aws/blob/main/docker_jenkins/Jenkinsfile): CI pipelines · Builds containers or runs Terraform. · `docker_jenkins/Jenkinsfile`
- [EKS app delivery](https://github.com/jbalajiavm/boto3-aws/blob/main/eks-codepipeline/buildspec.yml): container build and manifests · Buildspec packages a static app for Kubernetes. · `eks-codepipeline/buildspec.yml`
- [Kubernetes examples](https://github.com/jbalajiavm/boto3-aws/blob/main/argocd_demo/yamls/deployment.yaml): manifests and cluster config · Applied independently with kubectl. · `argocd_demo/yamls/deployment.yaml`

### Operational Utilities

Standalone diagnostics and alerting.

- [Diagnostics scripts](https://github.com/jbalajiavm/boto3-aws/blob/main/performance_tuning/performance-monitoring.py): Python and Bash tools · Host, website, log, and Kubernetes troubleshooting. · `performance_tuning/performance-monitoring.py`
- [AWS alerting](https://github.com/jbalajiavm/boto3-aws/blob/main/monitoring_and_alerting/sns_alert/main.tf): Terraform examples · SNS and S3-event notification infrastructure. · `monitoring_and_alerting/sns_alert/main.tf`

### Other components

- [Curriculum index](https://github.com/jbalajiavm/boto3-aws/blob/main/README.md): repository guide · Entry point for independent learning exercises. · `README.md`

## Connections

- Curriculum index → Standalone Terraform: indexes
- Curriculum index → Two-tier composition: indexes
- Curriculum index → Lambda automation: indexes
- Curriculum index → Jenkins workflows: indexes
- Standalone Terraform → AWS APIs: provisions
- Security policies → AWS APIs: configures access
- Network & storage → AWS APIs: provisions
- Two-tier composition → VPC networking: composes
- Two-tier composition → Application Load Balancer: composes
- Two-tier composition → EC2 & Auto Scaling: composes
- Two-tier composition → RDS MySQL: composes
- Two-tier composition → SNS notifications: composes
- VPC networking → EC2 & Auto Scaling: network for
- Application Load Balancer → EC2 & Auto Scaling: routes requests
- EC2 & Auto Scaling → RDS MySQL: uses MySQL
- Lambda automation → AWS APIs: operates
- Boto3 scripts → AWS APIs: operates
- Jenkins workflows → EKS app delivery: builds or deploys
- EKS app delivery → Kubernetes examples: deploys manifests
- Diagnostics scripts → Kubernetes examples: troubleshoots
- AWS alerting → AWS APIs: creates notifications
