Using Kiro to Identify and Fix Cloud Cost Waste Automatically
How Kiro analyzes infrastructure-as-code to find cost inefficiencies and generates remediation pull requests with projected savings.

Using Kiro to Identify and Fix Cloud Cost Waste Automatically
Cloud cost optimization is a peculiar discipline. Everyone agrees it matters. Finance sends monthly reports showing the bill climbing. Engineering teams nod, promise to look into it, and then go back to shipping features. The problem is not awareness — it is the activation energy required to actually find and fix waste. Identifying an oversized RDS instance is one thing. Generating the Terraform change, validating it will not break production, getting it reviewed and approved — that is a multi-day effort for each optimization.
Kiro collapses this workflow. It analyzes your infrastructure-as-code, identifies cost waste patterns, generates remediation PRs with projected savings, and provides the validation evidence reviewers need to approve with confidence. We used it to reduce our AWS bill by 34% in a single quarter.
The Cost Problem at Scale
Our AWS infrastructure served a B2B SaaS platform with roughly 200 Terraform-managed resources across three environments. Monthly spend had grown to $180K, and our quarterly cost review consistently identified the same categories of waste:
- Right-sizing failures: EC2 instances and RDS databases provisioned for peak load but running at 15-20% average utilization
- Zombie resources: EBS volumes, Elastic IPs, and load balancers attached to nothing
- Storage tier mismatches: S3 buckets with petabytes of infrequently accessed data in Standard tier
- Reserved Instance gaps: On-demand pricing for workloads that had been stable for over a year
- Over-provisioned networking: NAT Gateways processing traffic that could route through VPC endpoints
We knew about these issues. AWS Cost Explorer told us about them monthly. What we lacked was the engineering bandwidth to remediate them safely.
Kiro's Cost Analysis Workflow
We configured Kiro to analyze our Terraform modules against actual CloudWatch utilization data. The workflow uses a steering file that encodes our cost optimization policies:
# Cost Optimization Steering
## Right-Sizing Thresholds
- Flag EC2 instances with <30% average CPU over 14 days
- Flag RDS instances with <25% average CPU and <40% memory over 14 days
- Flag EBS volumes with <100 IOPS average over 7 days
## Storage Policies
- S3 objects not accessed in 90 days should use Intelligent-Tiering
- EBS volumes unattached for >7 days should be flagged for deletion
- Snapshots older than 90 days without retention tags should be flagged
## Networking
- NAT Gateway data processing >1TB/month to same-region AWS services
should recommend VPC endpoints
- Idle load balancers (0 active connections for 7 days) should be flagged
## Safety Constraints
- Never downsize production databases more than one instance class at a time
- Always recommend staging validation before production changes
- Preserve reserved capacity headroom of 20% above average utilization
Kiro then generated findings with specific Terraform changes:
# Finding: RDS instance over-provisioned
# Current: db.r6g.2xlarge ($1,460/month)
# Recommended: db.r6g.xlarge ($730/month)
# Evidence: Average CPU 18%, peak CPU 42%, average memory 35%
# Projected savings: $730/month ($8,760/year)
# Risk: Medium - validate with load test in staging first
resource "aws_db_instance" "orders_primary" {
identifier = "orders-primary"
- instance_class = "db.r6g.2xlarge"
+ instance_class = "db.r6g.xlarge"
# Kiro recommendation: Enable Performance Insights
# to monitor after resize
+ performance_insights_enabled = true
+ performance_insights_retention_period = 7
engine = "postgres"
engine_version = "15.4"
# ... remaining configuration unchanged
}
Notice that Kiro does not just change the instance size — it enables Performance Insights so the team can monitor the impact. This kind of operational awareness in generated remediations is what makes the changes actually shippable.
Automated S3 Lifecycle Policies
One of our largest waste categories was S3 storage. Kiro analyzed object access patterns and generated lifecycle policies:
# Finding: 4.2TB of objects in Standard tier not accessed in 90+ days
# Current cost: $96.60/month (Standard)
# Recommended cost: $21.00/month (Intelligent-Tiering)
# Projected savings: $75.60/month ($907/year) for this bucket alone
resource "aws_s3_bucket_intelligent_tiering_configuration" "analytics_archive" {
bucket = aws_s3_bucket.analytics_data.id
name = "analytics-tiering"
tiering {
access_tier = "DEEP_ARCHIVE_ACCESS"
days = 180
}
tiering {
access_tier = "ARCHIVE_ACCESS"
days = 90
}
filter {
prefix = "processed/"
tags = {
archive_eligible = "true"
}
}
}
resource "aws_s3_bucket_lifecycle_configuration" "analytics_cleanup" {
bucket = aws_s3_bucket.analytics_data.id
rule {
id = "expire-temp-objects"
status = "Enabled"
filter {
prefix = "tmp/"
}
expiration {
days = 7
}
}
}
Across 14 S3 buckets, Kiro identified $2,400/month in storage savings — just from applying appropriate tiering and cleaning up temporary objects that were never expired.
Before and After: Cost Remediation Velocity
| Metric | Before Kiro | After Kiro | Improvement |
|---|---|---|---|
| Monthly AWS spend | $180K | $119K | 34% reduction |
| Time per remediation PR | 4-6 hours | 30 minutes | 88% reduction |
| Remediations shipped/month | 3-5 | 15-20 | 4x increase |
| Days from identification to fix | 14-30 days | 2-3 days | 85% reduction |
| Cost savings realized per quarter | $12K | $48K first quarter | 4x improvement |
The compounding effect is significant. Because Kiro makes remediations easy to ship, the team actually ships them instead of adding them to a backlog that never gets prioritized against feature work.
The Governance Layer: Preventing Future Waste
Kiro's cost optimization is not just reactive. By adding cost-awareness to our steering files, every new infrastructure Kiro helps generate comes with cost considerations built in:
# Infrastructure Steering - Cost Requirements
When generating new AWS resources:
- Default to the smallest instance class that meets stated requirements
- Always include CloudWatch alarms for utilization monitoring
- Tag all resources with cost_center and team for attribution
- Include comments with monthly cost estimates for each resource
- Suggest spot instances for fault-tolerant workloads
- Default S3 buckets to Intelligent-Tiering unless sub-128KB objects dominate
This shifts cost optimization from a periodic cleanup exercise to a continuous practice embedded in every infrastructure change.
Conclusion
Cloud cost optimization fails in most organizations not because people do not care, but because the remediation work competes with feature development for engineering time — and features always win. Kiro eliminates this tension by making cost remediation nearly frictionless: identify waste, generate the fix, validate it, ship it. The entire cycle that used to take weeks now takes hours.
For CTOs and VPs of Engineering, the argument is straightforward. Kiro pays for itself many times over in the first month of cost remediations alone. More importantly, it establishes a continuous cost optimization practice that prevents waste from accumulating in the first place. The bill stops being a quarterly surprise and becomes a managed metric that trends in the right direction.
Recommended reading

The State of Agentic AI in 2026: Capabilities, Limitations, and Production Readiness
Comprehensive analysis of agentic AI in 2026 covering production capabilities, current limitations, and enterprise readiness benchmarks with real deployment data.

Observability for AI Agents: Tracing Multi-Step Reasoning Chains in Production
How to implement production observability for AI agents including distributed tracing, reasoning chain analysis, and debugging multi-step failures.

Measuring and Reducing AI Workload Carbon Emissions: A Practical Engineering Guide
Building a carbon-aware scheduling system for ML training and inference workloads that reduced our AI infrastructure emissions by 42% while maintaining SLA commitments.

Comments
No comments yet. Be the first to share your thoughts.