Modern cloud teams struggle with a frustrating gap:

FinOps tools show where money is being spent.

Monitoring tools show how resources are being used.

Terraform defines how infrastructure is provisioned.

But no system connects all three into a single automated loop. We were inspired by a simple question:

“If we already know the cost and the utilization, why can’t a system safely rewrite the infrastructure code for us?”

That idea led to FinOpsForge — an AI-driven platform that turns raw AWS billing and CPU metrics into actionable Terraform optimization code, with safety guardrails.

🧠 What it does FinOpsForge — AI Optimizer for Terraform Infrastructure automates the entire FinOps-to-IaC workflow:

Ingests AWS billing reports (CUR / Cost Explorer / CSV / Excel).

Accepts CPU utilization metrics from CloudWatch or uploaded files.

Auto-detects schema without requiring fixed column formats.

Merges cost and utilization into a unified dataset.

Applies a safety rule: If Avg CPU<20%⇒Eligible for downsizing\text{If Avg CPU} < 20\% \Rightarrow \text{Eligible for downsizing}If Avg CPU<20%⇒Eligible for downsizing

Uses AI logic to recommend better instance types.

Estimates monthly savings.

Generates ready-to-use Terraform code for the optimized infrastructure.

🏗️ How we built it The system is designed as an end-to-end automated workflow: 🔹 Data Ingestion Layer

Smart schema detection for billing files.

Flexible parsing for CSV, XLSX, and custom reports.

🔹 Metrics Processing Layer

CPU metrics ingestion.

Resource mapping between billing and utilization.

🔹 AI Optimization Engine

Rule-based guardrails.

Instance rightsizing logic.

Cost-saving estimation.

🔹 Terraform Generator

Converts optimization results into Terraform aws_instance blocks.

Produces copy-paste ready infrastructure code.

🔹 Web Interface

Upload-driven workflow.

Optional AWS credentials for live metrics.

Clear visualization of optimization results.

⚠️ Challenges we ran into

  1. Billing data is never consistent Every AWS billing export uses slightly different column names. We had to design a schema auto-detection system.
  2. Mapping cost data to metrics data Billing reports don’t contain CPU usage. Metrics don’t contain cost. Merging them reliably was complex.
  3. Safe optimization We needed to ensure the system never recommends downsizing a resource that is actually in use. The CPU guardrail logic was critical.
  4. Terraform correctness Generated code must be syntactically correct and practically usable without manual edits.

🏆 Accomplishments that we're proud of

Built a system that connects FinOps directly to Infrastructure as Code.

Designed intelligent schema ingestion that works with messy real-world data.

Created a practical AI workflow, not just a dashboard.

Generated Terraform from live cost + utilization insights.

Turned manual analysis into a one-click optimization pipeline.

📚 What we learned

Real cloud data is messy — automation must be flexible.

FinOps insights are powerful only when they lead to action.

Guardrails are as important as optimization logic.

Infrastructure teams value code output more than reports.

AI can bridge operational silos when applied to real workflows.

🔮 What’s next for FinOpsForge — AI Optimizer for Terraform Infrastructure We plan to extend FinOpsForge with:

GitHub PR automation for Terraform changes.

Support for EBS, RDS, and Kubernetes workloads.

Multi-cloud support (Azure, GCP).

Historical trend analysis for smarter recommendations.

Policy engine for enterprise guardrails.

Visualization dashboards for savings tracking.

📌 About the project FinOpsForge is an AI-powered system that transforms cloud billing and utilization data into safe, optimized Terraform infrastructure code. It demonstrates how FinOps, AI, and DevOps can work together in a closed automation loop:

Measure → Analyze → Optimize → Generate Code → Deploy

This project shows that the future of cloud cost optimization is not dashboards — it’s automated infrastructure intelligence.

Built With

  • agent
  • antigravity
  • aws-ec2
  • boto3
  • cloudwatch
  • cost-explorer-api
  • fastapi
  • github-api
  • iam
  • python
  • terraform-(hcl)
Share this project:

Updates