π Click the preview above to open the live-deployed dashboard.
- π Month-to-Date AWS Spend
- π Week-over-Week Cost Changes
- π§© Service-Level Cost Breakdown
- π· Business Category Mapping
- β‘ Live API Data (no mock JSON)
The dashboard consumes the production API:
GET /snapshot
and renders real cost data from AWS Cost Explorer.
These 9 foundational UML diagrams document the CloudCostCalculator system from both:
- Structural views (what the system is made of)
- Behavioral views (how the system acts over time)
Each diagram below is click-to-open.
The AWS Cloud Cost Calculator is a fully deployed, serverless cost-monitoring system that:
- Pulls Month-to-Date (MTD) spend from AWS Cost Explorer
- Publishes a custom CloudWatch metric
- Triggers budget alarms automatically
- Sends email alerts via Amazon SNS
- Generates automated weekly cost reports
- Exposes a production-ready API backend
- Powers a static dashboard hosted separately
This system eliminates surprise AWS bills by transforming billing data into actionable alerts and automated reporting.
β Automated cost monitoring
β Zero hardcoded credentials (IAM-role secured)
β Event-driven serverless architecture
β Threshold-based alerting system
β Weekly financial reporting automation
β Production-grade AWS wiring
Deployed serverless resources in us-east-1 + curated connections to reflect the end-to-end CCC pipeline.
The system uses AWS-native services in a fully serverless design.
AWS Cost Explorer
β
MetricsPublisher Lambda
β
CloudWatch Custom Metric (MTDSpendUSD)
β
CloudWatch Alarms
β
SNS Topic
β
Email Alerts
Separately:
API Gateway
β
CostApiFunction Lambda
β
Cost Explorer + S3 Mapping
β
Dashboard JSON Snapshot
AWS Cost Explorer (ce:GetCostAndUsage)
|
v
MetricsPublisherFunction-qHICp98n9xt3
|
v
CloudWatch Metric
Namespace: CloudCostCalculator
Metric: MTDSpendUSD
|
v
CloudWatch Alarms
ccc-mtdspend-prod-ge-50
ccc-mtdspend-prod-ge-200
|
v
SNS Topic
cloud-cost-calculator-BudgetAlertsTopic-QejtJZ6FnhMF
|
v
Email Subscribers
All screenshots below are from the live deployed environment in us-east-1.
The backend exposes:
GET /healthGET /snapshotGET /mappingPUT /mapping
These routes are directly integrated with Lambda.
Each route invokes a dedicated Lambda integration.
This confirms:
- Stateless architecture
- Direct Lambda invocation
- Clean REST-based backend
The system publishes:
Namespace: CloudCostCalculator
Metric: MTDSpendUSD
This metric represents real Month-to-Date AWS spend.
This demonstrates:
- Successful metric publishing
- Time-series tracking
- Alarm threshold alignment
Three production alarms monitor cost thresholds:
ccc-mtdspend-prod-ge-50ccc-mtdspend-prod-ge-100ccc-mtdspend-prod-ge-200
Each alarm triggers when:
MTDSpendUSD >= Threshold
for 1 datapoint within 1 day
This confirms:
- Active alarm evaluation
- Actions enabled
- Correct metric binding
- Production-ready alert logic
CloudWatch alarms publish to:
cloud-cost-calculator-BudgetAlertsTopic
Subscribers receive notifications when thresholds are breached.
This verifies:
- Confirmed email subscription
- Working alarm-to-SNS integration
- Functional alert distribution
A scheduled Lambda (WeeklyReportFunction) generates:
- Current week total
- Previous week total
- Percentage change
- Top services
- Business-category breakdown
This confirms:
- Programmatic cost aggregation
- Week-over-week analysis
- Automated formatting
- Real SNS email delivery
β No AWS credentials stored in repository
β Lambda uses IAM Execution Role
β No hardcoded keys
β CORS properly configured
β Environment variable isolation
β Least-privilege IAM policies
- Fully serverless (auto-scaling)
- Event-driven architecture
- Zero EC2 instances
- CloudWatch metric-based observability
- SNS-based decoupled alerting
- S3-hosted static frontend (low cost)
- Region-agnostic deployment
This design supports scaling across accounts and multi-environment deployments.
| Scenario | Estimated Monthly Cost |
|---|---|
| Light Usage | <$1 |
| Moderate Usage | ~$2β3 |
| High Lambda Invocation Volume | ~$5 |
Primary cost drivers:
- Lambda invocations
- CloudWatch metrics
- SNS email volume
Infrastructure remains highly cost-efficient.
| Metric | Result |
|---|---|
| API Snapshot Latency | <150ms |
| Alarm Detection Time | <60s |
| SNS Delivery | 5β15s |
| Manual Billing Time Reduction | ~90% |
| Monthly Infra Cost | ~$2β$6 |
- AWS Cost Explorer API (
ce:GetCostAndUsage) - AWS Lambda
- Amazon CloudWatch (Metrics + Alarms)
- Amazon SNS
- Amazon API Gateway
- Amazon S3
backend/ β Lambda backend (Cost API)
lambda/ β Scheduled metric/report functions
dashboard/ β Static frontend
infra/ β Deployment configs
assets/ β README images
- Lambda scales per invocation
- API Gateway handles concurrent traffic
- S3 supports virtually unlimited static requests
- Integrate AWS Organizations
- Publish per-account metric dimensions
- Use cross-account IAM roles
- IAM least privilege
- API Gateway authorizers (JWT / Cognito)
- CloudTrail auditing
- KMS encryption for SNS
- WAF integration
- CloudWatch dashboards
- Anomaly detection bands
- Centralized observability export
This project is licensed under the MIT License.
This repository demonstrates real-world AWS cost monitoring using a production-grade, serverless architecture.














