Prerequisites
AWS Account with Cost Access
Connect an AWS account with Cost Explorer API access enabled. The IAM role used by Kestrel needs
ce:GetCostAndUsage, ce:GetCostForecast, and related Cost Explorer permissions.Targeting Accounts
Use@cloud:connection-name to query costs for a specific AWS account. You can target multiple accounts for cross-account comparisons.
Spend Breakdown
Query costs by service, region, account, or any combination.Cost Trends Over Time
Track how costs change over days, weeks, and months.Anomaly Detection
Identify unusual cost patterns and unexpected charges.Resource-Level Costs
Drill into specific resources to understand cost drivers.Forecasting
Project future costs based on current trends.Cross-Account Comparison
Compare costs across multiple AWS accounts.Example Conversation
You:
@cloud:prod-aws Our AWS bill jumped 30% this month. What’s going on?
Kestrel:
Your total AWS spend for the current month is 36,300 last month (+30%). The top 3 drivers of the increase:You:
- EC2 — up $5,800 (+28%). Three new
m5.2xlargeinstances were launched inus-west-2on the 15th. They’re running in theanalyticsaccount and aren’t part of any Auto Scaling group.- RDS — up $3,100 (+41%). The
prod-analyticsinstance had a storage auto-scaling event that grew it from 500GB to 1.2TB. There was also a class change fromdb.r5.largetodb.r5.2xlargeon the 8th.- NAT Gateway — up $2,000 (+62%). Data processing through the NAT gateway in
us-east-1doubled compared to last month, likely from the new batch processing jobs.
Can we save money on those EC2 instances? They might be over-provisioned.Kestrel:
Based on CloudWatch metrics for the last 2 weeks, the threeYou:m5.2xlargeinstances inus-west-2average 12% CPU utilization and 4.2GB of memory usage (out of 32GB available). You have a few options:
- Right-size to
m5.large: Saves ~$4,200/month. The instances would still have headroom at 48% average CPU and 8GB memory.- Switch to Spot: These aren’t in an ASG but could tolerate interruption if they’re batch analytics jobs. Spot pricing for
m5.2xlargeinus-west-2is currently 67% cheaper.- Reserved Instances: If you need them long-term, a 1-year no-upfront RI for
m5.largewould save an additional 30% on top of right-sizing.
Let’s right-size them to m5.large. Can you find the Terraform code?
Kestrel:
The instances are defined inacme/infrastructure/terraform/analytics/ec2.tf. Here’s the proposed change to update all three fromm5.2xlargetom5.large: (displays Terraform diff with Create PR and Copy options)
Next Steps
- Kubernetes Investigation — query pods, deployments, events, and metrics
- Cloud Investigation — inspect AWS and OCI resources and security configurations
- Code Investigation — search and trace code changes across repositories
- Configuration Changes — generate and apply YAML and Terraform changes