# vinaygupta-devops/aws-disk-monitoring-solution architecture

> Architecture diagram of the GitHub repository vinaygupta-devops/aws-disk-monitoring-solution, 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/vinaygupta-devops/aws-disk-monitoring-solution
- Repository: https://github.com/vinaygupta-devops/aws-disk-monitoring-solution

## Overview

This repository provides cross-account EC2 disk monitoring: Ansible discovers tagged instances, enrolls them through Systems Manager, and configures the CloudWatch agent; the agent sends filesystem metrics to a central account for dashboards and fleet-wide alerting. CloudFormation supplies the central monitoring resources and member-account IAM roles, while Ansible inventory and playbooks drive enrollment and verification. Edges reflect the README’s documented architecture; source excerpts were unavailable, so implementation-level wiring beyond that documentation is not inferred.

Main entry points: [`ansible/inventory/aws_ec2.yml`](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/inventory/aws_ec2.yml) (Dynamic Inventory), [`ansible/playbooks/enroll.yml`](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/playbooks/enroll.yml) (Enroll Playbook), [`ansible/roles/disk_monitor/tasks/main.yml`](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/tasks/main.yml) (Disk Monitor Role), [`cloudformation/central-monitoring.yaml`](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml) (CloudWatch Metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_enrollment["Enrollment"]
  node_enroll_playbook["Enroll Playbook<br/>[enroll.yml]"]
  node_verify_playbook["Verify Playbook<br/>[verify.yml]"]
  node_dynamic_inventory["Dynamic Inventory<br/>[aws_ec2.yml]"]
  node_member_inventory["Account Inventory"]
  node_disk_role["Disk Monitor Role<br/>[main.yml]"]
  node_agent_config["Agent Configuration"]
  node_role_handler["Agent Handler<br/>[main.yml]"]
end

subgraph group_access["Access Management"]
  node_member_iam["Member IAM Stack"]
  node_central_iam["Central Metrics Role"]
end

subgraph group_monitoring["Monitoring"]
  node_cloudwatch[("CloudWatch Metrics")]
  node_dashboard["Metrics Dashboard"]
  node_fleet_alarm["Fleet Alarm"]
  node_sns["SNS Notifications"]
end

subgraph group_aws_runtime["AWS Runtime"]
  node_org["AWS Organizations"]
  node_ec2["EC2 Instances"]
  node_ssm["Systems Manager"]
  node_cloudwatch_agent["CloudWatch Agent"]
end

node_operator(("Operator"))
node_notification_targets(("Email, Slack, PagerDuty"))

node_operator -->|"runs"| node_enroll_playbook
node_operator -.->|"runs"| node_verify_playbook
node_org -->|"supplies accounts"| node_dynamic_inventory
node_member_inventory -.->|"configures sources"| node_dynamic_inventory
node_enroll_playbook -->|"uses"| node_dynamic_inventory
node_enroll_playbook -->|"applies"| node_disk_role
node_dynamic_inventory -->|"discovers tagged instances"| node_ec2
node_enroll_playbook -->|"runs enrollment through"| node_ssm
node_ssm -->|"manages"| node_ec2
node_disk_role -->|"writes configuration"| node_agent_config
node_disk_role -->|"notifies"| node_role_handler
node_disk_role -->|"installs and configures agent"| node_ec2
node_verify_playbook -->|"uses"| node_dynamic_inventory
node_verify_playbook -->|"verifies via"| node_ssm
node_member_iam -->|"provides instance profile"| node_ec2
node_member_iam -->|"authorizes role assumption"| node_central_iam
node_ec2 -->|"assumes metrics role"| node_central_iam
node_ec2 -->|"runs"| node_cloudwatch_agent
node_cloudwatch_agent -->|"publishes metrics"| node_cloudwatch
node_central_iam -->|"permits metric writes"| node_cloudwatch
node_cloudwatch -->|"feeds metrics"| node_dashboard
node_cloudwatch -->|"evaluates threshold"| node_fleet_alarm
node_fleet_alarm -->|"publishes alarm"| node_sns
node_sns -->|"notifies"| node_notification_targets

click node_enroll_playbook "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/playbooks/enroll.yml"
click node_verify_playbook "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/playbooks/verify.yml"
click node_dynamic_inventory "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/inventory/aws_ec2.yml"
click node_member_inventory "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/inventory/member-account.aws_ec2.yml.example"
click node_disk_role "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/tasks/main.yml"
click node_agent_config "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/templates/amazon-cloudwatch-agent.json.j2"
click node_role_handler "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/handlers/main.yml"
click node_member_iam "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/member-account-iam.yaml"
click node_central_iam "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml"
click node_cloudwatch "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml"
click node_dashboard "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml"
click node_fleet_alarm "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml"
click node_sns "https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml"

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_enroll_playbook,node_verify_playbook,node_dynamic_inventory,node_member_inventory,node_disk_role,node_agent_config,node_role_handler toneBlue
class node_member_iam,node_central_iam toneAmber
class node_cloudwatch,node_dashboard,node_fleet_alarm,node_sns toneMint
class node_org,node_ec2,node_ssm,node_cloudwatch_agent toneRose
class node_operator,node_notification_targets toneIndigo
```

## Components

### Enrollment

- [Enroll Playbook](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/playbooks/enroll.yml): `ansible/playbooks/enroll.yml`
- [Verify Playbook](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/playbooks/verify.yml): `ansible/playbooks/verify.yml`
- [Dynamic Inventory](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/inventory/aws_ec2.yml): `ansible/inventory/aws_ec2.yml`
- [Account Inventory](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/inventory/member-account.aws_ec2.yml.example): `ansible/inventory/member-account.aws_ec2.yml.example`
- [Disk Monitor Role](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/tasks/main.yml): `ansible/roles/disk_monitor/tasks/main.yml`
- [Agent Configuration](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/templates/amazon-cloudwatch-agent.json.j2): `ansible/roles/disk_monitor/templates/amazon-cloudwatch-agent.json.j2`
- [Agent Handler](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/ansible/roles/disk_monitor/handlers/main.yml): `ansible/roles/disk_monitor/handlers/main.yml`

### Access Management

- [Member IAM Stack](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/member-account-iam.yaml): `cloudformation/member-account-iam.yaml`
- [Central Metrics Role](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml): `cloudformation/central-monitoring.yaml`

### Monitoring

- [CloudWatch Metrics](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml): `cloudformation/central-monitoring.yaml`
- [Metrics Dashboard](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml): `cloudformation/central-monitoring.yaml`
- [Fleet Alarm](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml): `cloudformation/central-monitoring.yaml`
- [SNS Notifications](https://github.com/vinaygupta-devops/aws-disk-monitoring-solution/blob/main/cloudformation/central-monitoring.yaml): `cloudformation/central-monitoring.yaml`

### AWS Runtime

- **AWS Organizations**
- **EC2 Instances**
- **Systems Manager**
- **CloudWatch Agent**

### Other components

- **Operator**
- **Email, Slack, PagerDuty**

## Connections

- Operator → Enroll Playbook: runs
- Operator → Verify Playbook: runs
- AWS Organizations → Dynamic Inventory: supplies accounts
- Account Inventory → Dynamic Inventory: configures sources
- Enroll Playbook → Dynamic Inventory: uses
- Enroll Playbook → Disk Monitor Role: applies
- Dynamic Inventory → EC2 Instances: discovers tagged instances
- Enroll Playbook → Systems Manager: runs enrollment through
- Systems Manager → EC2 Instances: manages
- Disk Monitor Role → Agent Configuration: writes configuration
- Disk Monitor Role → Agent Handler: notifies
- Disk Monitor Role → EC2 Instances: installs and configures agent
- Verify Playbook → Dynamic Inventory: uses
- Verify Playbook → Systems Manager: verifies via
- Member IAM Stack → EC2 Instances: provides instance profile
- Member IAM Stack → Central Metrics Role: authorizes role assumption
- EC2 Instances → Central Metrics Role: assumes metrics role
- EC2 Instances → CloudWatch Agent: runs
- CloudWatch Agent → CloudWatch Metrics: publishes metrics
- Central Metrics Role → CloudWatch Metrics: permits metric writes
- CloudWatch Metrics → Metrics Dashboard: feeds metrics
- CloudWatch Metrics → Fleet Alarm: evaluates threshold
- Fleet Alarm → SNS Notifications: publishes alarm
- SNS Notifications → Email, Slack, PagerDuty: notifies
