
Weekend Challenge: Turn One Annoying Task Into an App: CloudGuard FinOps AI Agent
CloudGuard is an automated, serverless FinOps agent that turns this manual morning audit into an effortless automated briefing delivered directly to your email.
Tag:#productivity #apps
🎯 Vision & What the App Does
😩 The Annoying Task
Every cloud engineer knows the gut-wrenching feeling of logging into the AWS Management Console, opening the Billing Dashboard, and discovering that your personal budget or Free Tier credits took a sudden, unexpected hit.
My specific "annoying task" started after I provisioned an AWS ECS Fargate cluster along with supporting infrastructure—including RDS databases, NAT Gateways, and EBS volumes—for quick local testing. After finishing my experiments, I thought I had torn everything down cleanly.
However, several micro-services and unattached resources kept running silently in the background. Days later, I noticed my Free Tier credits were draining rapidly.
To prevent future billing surprises, I forced myself into a tedious daily routine:
- 🔍 Logging into the AWS Console every single morning.
- 📊 Clicking through Cost Explorer to inspect daily spend.
- 💾 Checking multiple AWS regions for unattached EBS volumes.
- 🌐 Scanning for unassociated Elastic IPs.
- 🧮 Manually calculating potential cloud burn rates.
It was a slow, repetitive chore that consumed focus and caused unnecessary mental fatigue.
💡 The Solution: CloudGuard AI Agent
CloudGuard is an automated, serverless FinOps agent that turns this manual morning audit into an effortless, automated briefing delivered directly to your inbox.
Every morning at 07:00 AM UTC, CloudGuard automatically:
- Inspects your AWS account telemetry.
- Queries Cost Explorer for exact micro-spends.
- Scans for dangling or idle infrastructure.
- Sends the raw JSON metrics to Amazon Bedrock (Amazon Nova Lite) for intelligent FinOps analysis.
- Dispatches a clean executive digest straight to your email.
You never have to manually log in to check if forgotten ECS tasks or EBS volumes are draining your credits again!
🛠️ How I Built It
Building CloudGuard required moving beyond quick ad-hoc scripts to a fully automated, Infrastructure-as-Code (IaC) deployment pipeline.
📐 Architecture & Telemetry Pipeline



⚙️ Core Components
- Telemetry Collection Layer: A Python script executed inside an AWS Lambda function using boto3. The function queries the AWS Cost Explorer API (ce:GetCostAndUsage) to fetch yesterday's unblended daily costs grouped by service. Simultaneously, it calls the EC2 API (ec2:DescribeVolumes and ec2:DescribeAddresses) to catch idle EBS volumes or unassigned Elastic IPs.
- AI Reasoning Engine: Instead of relying on rigid, hardcoded string templates, raw telemetry JSON is sent to Amazon Bedrock using the amazon.nova-lite-v1:0 model via the Converse API. Bedrock evaluates financial risks and generates a structured FinOps summary with actionable Free Tier preservation tips.
- Notification Pipeline: The final briefing is formatted and dispatched directly to the user's registered address using Amazon SNS.
- Automated Scheduling: An Amazon EventBridge rule configured with a cron(0 7 * * ? *) schedule triggers the workflow completely hands-free every morning.
-
AWS Services Used / Architecture Overview
CloudGuard runs entirely on a serverless, cost-effective AWS stack designed to fit within Free Tier parameters:
AWS Service | Role in CloudGuard |
|---|---|
AWS Lambda (Python 3.12) | Core runtime environment executing telemetry collection and AI orchestration logic. |
Amazon Bedrock (amazon.nova-lite-v1:0) | Generative AI engine parsing raw billing JSON into concise natural language summaries. |
AWS Cost Explorer API | Fetches real-time service billing breakdowns and unblended spend metrics. |
Amazon EC2 API | Audits active block storage volumes and static public IPs for idle resources. |
Amazon EventBridge | Automated cron scheduler triggering execution every morning at 07:00 UTC. |
Amazon SNS / SES | Handles message publishing and email delivery. |
HashiCorp Terraform | Manages entire Infrastructure-as-Code setup for single-command deployments. |
🎓 What I Learned
Participating in this challenge reinforced several core cloud engineering principles:
- FinOps Automation is Vital: Human memory is a poor monitoring system. Automating infrastructure auditing removes cognitive overhead and prevents unexpected credit consumption.
- LLMs as Telemetry Interpreters: Generative AI excels at transforming unstructured or complex API JSON blobs into contextual, human-readable executive summaries.
- Infrastructure as Code (IaC) Speed: Using Terraform to manage IAM roles, Lambda event sources, and EventBridge rules ensures security policies and deployment configurations stay consistent and repeatable.
Link to App or Repo
- 🐙 Public GitHub Repository: https://github.com/SamChus/CloudGuard
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article