How sdz0z6/bedrock works
Bedrock Cost is a Flask dashboard for read-only AWS cost, model-usage, and quota monitoring, with account-ledger management and scheduled alerts. The main user workflow is login → select a dashboard page → load accounts and query the relevant AWS data → render reports and charts. Separate flows estimate current-day cost from CloudWatch metrics and public prices, and send scheduled Telegram or email alerts. The README documents these product capabilities; some implementation details are unsampled, so those relationships are shown only where documented or indexed.
Main entry points: views.py Page routes · alerts.py Scheduled alert jobs · cloudwatch_metrics.py CloudWatch metrics · mail_alerts.py Email alerts
Components 26
Web application
- Flask application
src/bedrock_cost/__init__.py - Page routes
src/bedrock_cost/views.py
Cost reporting
- Cost Explorer data
src/bedrock_cost/cost_explorer.py - Account cost report
src/bedrock_cost/report.py - Cost usage breakdown
src/bedrock_cost/usage_explorer.py - Cost estimator
src/bedrock_cost/cost_estimate.py - Model pricing
src/bedrock_cost/pricing.py - Stacked chart renderer
src/bedrock_cost/chart.py
Model monitoring
- CloudWatch metrics
src/bedrock_cost/cloudwatch_metrics.py - Model quotas
src/bedrock_cost/quotas.py
Accounts and access
- Login and protection
src/bedrock_cost/auth.py - Account ledger
src/bedrock_cost/excel_source.py - Runtime settings
src/bedrock_cost/config.py
Alerts and messaging
- Scheduled alert jobs
src/bedrock_cost/alerts.py - Email alerts
src/bedrock_cost/mail_alerts.py - Mailbox reader
src/bedrock_cost/mail_inbox.py - Mail rules
src/bedrock_cost/mail_rules.py - Alert cards
src/bedrock_cost/cards.py - Telegram client
src/bedrock_cost/telegram.py
Other components
- Dashboard user
- AWS Cost Explorer
- AWS CloudWatch
- Bedrock and Quotas
- AWS public pricing
- Account mail server
- Telegram API
Connections 31
- Dashboard user → Flask application: opens dashboard
README.md - Flask application → Login and protection: registers login
src/bedrock_cost/__init__.py - Flask application → Page routes: registers routes
src/bedrock_cost/__init__.py - Page routes → Login and protection: protects pages
src/bedrock_cost/views.py - Page routes → Account ledger: loads accounts
src/bedrock_cost/views.py - Page routes → Account cost report: builds overview
README.md - Account cost report → Cost Explorer data: fetches costs
src/bedrock_cost/report.py - Cost Explorer data → AWS Cost Explorer: queries costs
src/bedrock_cost/cost_explorer.py - Page routes → Cost usage breakdown: builds breakdown
src/bedrock_cost/views.py - Cost usage breakdown → AWS Cost Explorer: queries costs
src/bedrock_cost/usage_explorer.py - Page routes → Stacked chart renderer: renders charts
src/bedrock_cost/views.py - Page routes → CloudWatch metrics: loads model usage
src/bedrock_cost/views.py - CloudWatch metrics → AWS CloudWatch: queries metrics
src/bedrock_cost/cloudwatch_metrics.py - CloudWatch metrics → Bedrock and Quotas: resolves profiles
src/bedrock_cost/cloudwatch_metrics.py - Page routes → Model quotas: builds quota report
src/bedrock_cost/views.py - Model quotas → Bedrock and Quotas: loads quotas
README.md - Page routes → Cost estimator: builds estimate
src/bedrock_cost/views.py - Cost estimator → CloudWatch metrics: reads metrics
src/bedrock_cost/cost_estimate.py - Cost estimator → Model pricing: applies prices
src/bedrock_cost/cost_estimate.py - Model pricing → AWS public pricing: fetches price list
README.md - Page routes → Runtime settings: uses settings
src/bedrock_cost/views.py - Scheduled alert jobs → Account ledger: loads accounts
src/bedrock_cost/accounts.py - Scheduled alert jobs → Cost Explorer data: fetches costs
src/bedrock_cost/alerts.py - Scheduled alert jobs → CloudWatch metrics: reads usage
src/bedrock_cost/alerts.py - Scheduled alert jobs → Alert cards: builds cards
src/bedrock_cost/alerts.py - Scheduled alert jobs → Telegram client: sends alerts
src/bedrock_cost/alerts.py - Telegram client → Telegram API: sends messages
src/bedrock_cost/telegram.py - Email alerts → Mailbox reader: reads messages
src/bedrock_cost/mail_alerts.py - Email alerts → Mail rules: applies rules
src/bedrock_cost/mail_alerts.py - Mailbox reader → Account mail server: reads inbox
src/bedrock_cost/mail_inbox.py - Email alerts → Telegram client: notifies groups
src/bedrock_cost/mail_alerts.py