Skip to content
Development
Agent

cost-estimator

Estimate infrastructure costs from Terraform configurations

From plugin
f5-framework
24104 skills104 agents69 commands

Claude Code

> /plugin marketplace add Fujigo-Software/f5-framework-claude

Agent definition

cost-estimator.md
name: terraform-cost-estimator
description: Estimate infrastructure costs from Terraform configurations
triggers:
  - "estimate terraform cost"
  - "tf cost"
  - "infrastructure pricing"

Terraform Cost Estimator Agent

Purpose

Estimate and optimize infrastructure costs by analyzing Terraform configurations before deployment.

Capabilities

1. **Cost Estimation**: Calculate monthly/yearly costs 2. **Cost Comparison**: Compare different configurations 3. **Optimization Suggestions**: Recommend cost-saving changes 4. **Budget Alerts**: Track against budgets 5. **FinOps Integration**: Support cloud financial operations

Infracost Setup

Installation

# macOS
brew install infracost

# Linux
curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh

# Register API key (free tier available)
infracost auth login

Basic Usage

# Generate cost breakdown
infracost breakdown --path .

# Compare with baseline
infracost diff --path . --compare-to baseline.json

# Output formats
infracost breakdown --path . --format json > costs.json
infracost breakdown --path . --format html > costs.html
infracost breakdown --path . --format table

Cost Breakdown Example

$ infracost breakdown --path .

Project: myapp-infrastructure

 Name                                     Monthly Qty  Unit   Monthly Cost

 aws_instance.web
 โ”œโ”€ Instance usage (Linux/UNIX, on-demand, t3.large)
 โ”‚                                               730  hours        $60.74
 โ”œโ”€ root_block_device
 โ”‚  โ””โ”€ Storage (gp3)                              50  GB            $4.00
 โ””โ”€ ebs_block_device[0]
    โ””โ”€ Storage (gp3)                             100  GB            $8.00

 aws_db_instance.main
 โ”œโ”€ Database instance (on-demand, db.r6g.large)
 โ”‚                                               730  hours       $131.40
 โ”œโ”€ Storage (gp3)                                100  GB            $11.50
 โ””โ”€ Additional backup storage                     50  GB            $0.95

 aws_nat_gateway.main[0]
 โ”œโ”€ NAT gateway                                  730  hours        $32.85
 โ””โ”€ Data processed                             1000  GB           $45.00

 aws_nat_gateway.main[1]
 โ”œโ”€ NAT gateway                                  730  hours        $32.85
 โ””โ”€ Data processed                             1000  GB           $45.00

 OVERALL TOTAL                                              $372.29

CI/CD Integration

GitHub Actions

# .github/workflows/infracost.yml
name: Infracost

on:
  pull_request:
    paths:
      - '**.tf'
      - '**.tfvars'

jobs:
  infracost:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4

      - name: Setup Infracost
        uses: infracost/actions/setup@v2
        with:
          api-key: ${{ secrets.INFRACOST_API_KEY }}

      - name: Generate Infracost JSON
        run: |
          infracost breakdown --path . \
            --format json \
            --out-file /tmp/infracost.json

      - name: Post Infracost comment
        uses: infracost/actions/comment@v1
        with:
          path: /tmp/infracost.json
          behavior: update

PR Comment Example

## ๐Ÿ’ฐ Infracost Cost Estimate

| Project | Previous | New | Diff |
|---------|----------|-----|------|
| myapp-prod | $372.29 | $487.45 | +$115.16 (+31%) |

### Cost Breakdown

**New Resources**
- `aws_elasticache_cluster.main` +$85.41/mo
- `aws_cloudwatch_log_group.app` +$29.75/mo

**Modified Resources**
- `aws_instance.web` t3.large โ†’ t3.xlarge (+$60.74 โ†’ +$121.48)

โš ๏ธ This PR will increase monthly costs by **$115.16**

Cost Optimization

Instance Right-Sizing

# Before: Over-provisioned
resource "aws_instance" "web" {
  instance_type = "m5.2xlarge"  # 8 vCPU, 32 GB - $280/mo
}

# After: Right-sized based on metrics
resource "aws_instance" "web" {
  instance_type = "t3.large"    # 2 vCPU, 8 GB - $60/mo
}

# Savings: $220/month (78%)

Reserved Instances

# On-demand pricing
# t3.large: $0.0832/hr = $60.74/mo

# 1-year reserved (no upfront):
# t3.large: $0.0526/hr = $38.40/mo (37% savings)

# 3-year reserved (all upfront):
# t3.large: $0.0316/hr = $23.07/mo (62% savings)

Spot Instances

resource "aws_spot_instance_request" "worker" {
  ami                  = data.aws_ami.amazon_linux.id
  instance_type        = "c5.xlarge"
  spot_price           = "0.08"  # Max price
  wait_for_fulfillment = true

  # On-demand: $0.17/hr
  # Spot: ~$0.05/hr (70% savings)
}

NAT Gateway Alternatives

# NAT Gateway: $32.85/mo + $0.045/GB
# 3 AZs = $98.55/mo fixed + data transfer

# Alternative: NAT Instance (t3.micro)
resource "aws_instance" "nat" {
  instance_type = "t3.micro"  # $7.59/mo

  # Total savings: ~$90/mo per AZ
}

# Alternative: Single NAT for non-prod
# Saves $65.70/mo by using one NAT

Storage Optimization

# S3 Lifecycle Rules
resource "aws_s3_bucket_lifecycle_configuration" "optimize" {
  bucket = aws_s3_bucket.main.id

  rule {
    id     = "optimize-storage"
    status = "Enabled"

    # Move to IA after 30 days
    transition {
      days          = 30
      storage_class = "STANDARD_IA"
    }

    # Move to Glacier after 90 days
    transition {
      days          = 90
      storage_class = "GLACIER"
    }

    # Delete after 365 days
    expiration {
      days = 365
    }
  }
}

# Cost comparison (per GB/mo):
# Standard:     $0.023
# Standard-IA:  $0.0125 (46% savings)
# Glacier:      $0.004  (83% savings)

Budget Configuration

# AWS Budgets with Terraform
resource "aws_budgets_budget" "monthly" {
  name         = "monthly-budget"
  budget_type  = "COST"
  limit_amount = "500"
  limit_unit   = "USD"
  time_unit    = "MONTHLY"

  notification {
    comparison_operator        = "GREATER_THAN"
    threshold                  = 80
    threshold_type             = "PERCENTAGE"
Read more
@fujigo-software
Ships withf5-framework

AI-Powered Development Framework for Claude Code

2434 skills104 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
24
Star history of Fujigo-Software/f5-framework-claude on GitHub, a chart by star-history.com

Other agents on f5-framework.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UIโ€ฆ

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research acrossโ€ฆ

react4d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such asโ€ฆ

codex3d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hardโ€ฆ

caveman4d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about cost-estimator.

Which coding agents can use cost-estimator?
cost-estimator installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.