Cloud Optimization
Optimization Engine
The StackFlow Cloud Optimization engine analyzes your cloud resource utilization and spend data to identify cost savings opportunities. It combines AWS Cost Explorer data, CloudWatch metrics, and AI analysis to provide ranked, actionable recommendations with estimated savings amounts and implementation risk levels.
- AWS Cost Explorer: Cost Explorer enabled in connected accounts with at least 7 days of billing data
- AWS Compute Optimizer: Opt-in required in each connected account for rightsizing recommendations
- DynamoDB:
StackFlow_OptimizationRecommendationtable for storing and tracking recommendations - IAM:
StackFlowDiscoveryRolewithce:GetRightsizingRecommendation,compute-optimizer:GetEC2InstanceRecommendations
Right-Sizing Recommendations
Right-sizing analyzes CPU, memory, and network utilization over the past 14 days to identify over-provisioned resources. For example, an EC2 instance using less than 10% CPU on average is flagged as a right-sizing candidate with a recommendation to downsize to a smaller instance type.
| Resource Type | Data Source | Recommendation Type | Estimated Savings |
|---|---|---|---|
| EC2 instances | CloudWatch CPU/Mem/Net | Downsize instance type | Up to 60% |
| RDS instances | CloudWatch + Performance Insights | Downsize instance class | Up to 50% |
| Lambda | CloudWatch Duration | Reduce memory allocation | Up to 40% |
| ElastiCache | CloudWatch Memory+Connections | Downsize node type | Up to 30% |
Idle Resource Detection
Idle resource detection identifies resources with near-zero utilization that may have been forgotten. Common findings include: stopped EC2 instances with attached EBS volumes (paying for storage), unused Elastic IP addresses (paying for unattached EIPs), empty S3 buckets with versioning enabled (accumulating old versions), and idle load balancers with no registered targets.
Savings Plans Analysis
The savings plans analysis compares your current on-demand spend against the cost of committing to 1-year or 3-year Savings Plans or Reserved Instances. The analysis uses your 30-day usage history to calculate the optimal commitment level that maximizes savings while minimizing over-commitment risk.
Implementing Recommendations
Recommendations can be implemented directly from the StackFlow console (for supported actions) or exported as an implementation plan. For each recommendation, StackFlow can create a Change record with the implementation details, risk assessment, and rollback plan pre-populated. This ensures all cloud changes go through the standard CAB approval process.
curl -X POST https://your-instance.stackflow-tech.com/prod/api/cloud/optimization/recommendations/rec_abc123/implement -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"create_change_record": true, "change_type": "standard", "scheduled_date": "2026-05-25T02:00:00Z"}'