---
name: finops-cloud-financial
description: Implement FinOps practices for cloud financial management including cost allocation, showback/chargeback, anomaly detection, right-sizing recommendations, reserved instance optimization, and cloud budget management. Use when managing cloud costs, implementing chargeback, optimizing cloud spend, or establishing FinOps governance. Triggers on phrases like "FinOps", "cloud costs", "chargeback", "showback", "cloud optimization", "reserved instances", "savings plans", "cost allocation", "cloud budget", "anomaly detection", "right-sizing", "waste identification", "cloud tagging", "cost attribution", "cloud financial management".
---

# FinOps & Cloud Financial Management

Implement FinOps practices for cloud financial management including cost allocation, optimization, and governance.

## Workflow

### 1. Cloud Cost Governance

```
FINOPS MATURITY MODEL
═══════════════════════════════════════

Phase 1: INFORM (Visibility)
═══════════════════════════════════════

  → Centralized cloud cost dashboard
  → Cost breakdown by: service, team, project, environment
  → Daily cost tracking
  → Tagging policy enforcement
  → Budget alerts (80%, 90%, 100%)

Phase 2: OPTIMIZE (Efficiency)
═══════════════════════════════════════

  → Right-sizing recommendations
  → Reserved instance / savings plan coverage
  → Idle resource identification
  → Storage tier optimization
  → Commitment-based pricing adoption

Phase 3: OPTIMIZE (Architecture)
═══════════════════════════════════════

  → Architecture cost review
  → Multi-region cost analysis
  → Spot instance adoption
  → Serverless evaluation
  → Data transfer optimization

Phase 4: OPERATE (Culture)
═══════════════════════════════════════

  → Showback/chargeback implementation
  → Cost ownership accountability
  → FinOps training for engineering
  → Cost/performance trade-off reviews
  → Quarterly business reviews

CURRENT MATURITY: Phase 2 (Optimize - Efficiency)
```

### 2. Cost Allocation & Tagging

```
TAGGING STRATEGY
═══════════════════════════════════════

Required Tags:
═══════════════════════════════════════

Tag                 Values                    Enforced    Purpose
────────────────────────────────────────────────────────────────────
Environment         production/staging/dev    YES         Cost separation
Team                eng/finance/hr/sales      YES         Chargeback
Project             project-alpha/beta/...    YES         Budget tracking
Application         api-gateway/auth/...      YES         Service costing
CostCenter          CC-1001/CC-2003/...       YES         Financial reporting
Owner               john.doe/jane.smith       YES         Accountability
Compliance          pci/hipaa/standard        YES         Security

AUTOMATED TAG ENFORCEMENT:
═══════════════════════════════════════

  → CloudFormation/Terraform: Required tags in templates
  → AWS Config Rule: Tag compliance (auto-remediate)
  → Untagged resources: Alert + auto-tag or terminate
  → Compliance rate target: 100%

COST ALLOCATION REPORT — Monthly:
═══════════════════════════════════════

Team            Compute   Storage   Network   Database   Total      Budget     Variance
──────────────────────────────────────────────────────────────────────────────────────
Engineering     $12,000   $3,200    $1,800    $4,500     $21,500    $25,000    -14% ✓
Finance          $2,500    $800      $200      $1,200      $4,700    $5,000     -6% ✓
HR               $1,200    $400      $100      $600        $2,300    $2,500     -8% ✓
Sales            $3,000    $600      $300      $1,500      $5,400    $5,000     +8% ⚠
Analytics        $5,000    $4,200    $800      $2,000      $12,000   $10,000   +20% 🔴
──────────────────────────────────────────────────────────────────────────────────────
TOTAL           $23,700   $9,200    $3,200    $9,800     $45,900    $47,500   -3% ✓
```

### 3. Cost Optimization

```
CLOUD COST OPTIMIZATION — Monthly Report
═══════════════════════════════════════

IDENTIFIED SAVINGS OPPORTUNITIES:
═══════════════════════════════════════

Category              Current Cost    Optimized     Monthly Savings  Effort
─────────────────────────────────────────────────────────────────────────────
Right-sizing           $8,500         $5,200        $3,300          Low
Unused instances       $2,800          $0           $2,800          Low
Reserved instances    $15,000         $10,500       $4,500          Medium
Savings Plans          $6,200         $4,100        $2,100          Medium
Storage tiering        $3,200         $1,800        $1,400          Low
Spot instances         $4,000         $1,200        $2,800          Medium
IP address cleanup      $200          $0            $200            Low
Database optimization   $3,800        $2,500        $1,300          High
─────────────────────────────────────────────────────────────────────────────
TOTAL SAVINGS:                              $18,400/month

RIGHT-SIZING ANALYSIS:
═══════════════════════════════════════

Instance         Current    Avg CPU   Avg Mem    Recommended    Savings
───────────────────────────────────────────────────────────────────────────
i-001            m5.2xlarge 25%       35%       m5.xlarge       $220/mo
i-002            c5.xlarge  15%       20%       t3.large        $180/mo
i-003            r5.xlarge  45%       85%       r5.xlarge       $0 (keep)
i-004            m5.xlarge  8%        12%       t3.medium       $120/mo
i-005            c5.2xlarge 30%       25%       c5.xlarge       $300/mo

RESERVED INSTANCE COVERAGE:
═══════════════════════════════════════

  Current coverage: 45%
  Target coverage: 75%
  Available for RI: 28 instances (stable workloads)
  Recommended: 1-year standard RI for 20 instances
  Savings: $4,500/month

WASTE IDENTIFICATION:
═══════════════════════════════════════

Resource Type       Count    Monthly Cost    Action
───────────────────────────────────────────────────────
Stopped EC2         8        $450            Terminate + snapshot
Unused EBS          15       $380            Delete (no snapshots)
Unattached EIP      5        $175            Release
Empty ELB           2        $150            Remove
Zombie RDS          1        $200            Snapshot + delete
Unused NAT GW       1        $350            Review + remove
───────────────────────────────────────────────────────
TOTAL WASTE:                  $1,705
```

### 4. Budget Management & Anomaly Detection

```
BUDGET MANAGEMENT
═══════════════════════════════════════

Budget Hierarchy:
═══════════════════════════════════════

  Organization Total: $47,500/month
  └── Engineering: $25,000/month
  ├── Finance: $5,000/month
  ├── HR: $2,500/month
  ├── Sales: $5,000/month
  └── Analytics: $10,000/month

Alert Configuration:
═══════════════════════════════════════

Threshold    Action           Channel        Audience
────────────────────────────────────────────────────────────
50%          Info log         —              System
70%          Warning          Slack          Team lead
80%          Warning          Slack + Email  Team lead + manager
90%          Alert            Slack + Email  Manager + FinOps
100%         Critical         PagerDuty      FinOps + Engineering
120%         Critical         PagerDuty + Page VP Eng + CTO

ANOMALY DETECTION:
═══════════════════════════════════════

Detected anomalies (last 30 days):
═══════════════════════════════════════

Date        Service         Cost     Normal Range   Deviation   Root Cause
───────────────────────────────────────────────────────────────────────────
01/15       EC2            $3,200    $1,200-$1,800  +89%       Unstopped dev instances
01/22       S3             $850      $300-$500      +70%       Uncompressed logs
02/03       RDS            $1,500    $800-$1,200    +42%       Read replica created
02/10       Data Transfer  $680      $100-$300      +127%      Cross-region traffic
02/18       Lambda         $420      $150-$250      +68%       Function recursion

ANOMALY RESPONSE PROCESS:
═══════════════════════════════════════

  1. Detection: Automated (AWS Cost Anomaly Detection / custom)
  2. Alert: Slack notification to team + FinOps
  3. Investigation: Root cause analysis (24 hours)
  4. Resolution: Fix the issue (stop, resize, optimize)
  5. Prevention: Add guardrails (budget limits, tagging, quotas)
```

### 5. Commitment Optimization

```
COMMITMENT STRATEGY
═══════════════════════════════════════

Reserved Instances (RI):
═══════════════════════════════════════

  Current coverage: 45%
  Target: 75%

  Pool analysis:
    → Stable workloads (24/7): 28 instances → 1-year Standard RI
    → Growing workloads: 12 instances → 1-year No Upfront RI
    → Predictable batch: 8 instances → Scheduled RI

  Projected savings: $4,500/month

Savings Plans:
═══════════════════════════════════════

  Compute Savings Plan:
    → Commitment: $8,000/month
    → Term: 1 year
    → Coverage: EC2 + Fargate + Lambda
    → Discount: 17% vs on-demand
    → Savings: $1,360/month

  EC2 Instance Savings Plan:
    → Commitment: $5,000/month
    → Term: 3 years
    → Discount: 35% vs on-demand
    → Savings: $1,750/month

SPOT INSTANCES:
═══════════════════════════════════════

  Workloads eligible:
    → CI/CD pipelines: 100% spot (fault-tolerant)
    → Batch processing: 80% spot (checkpoint-based)
    → Dev/test environments: 60% spot (non-critical)
    → ML training: 90% spot (can restart)

  Savings: 60-90% vs on-demand
  Risk mitigation:
    → Mixed instance policy (spot + on-demand)
    → Auto-recovery on interruption
    → Checkpoint-based processing
```

## Edge Cases

- **Multi-cloud**: Aggregate costs across AWS, Azure, GCP
- **Multi-account**: Consolidated billing, cost allocation
- **Showback vs chargeback**: Cultural considerations, adoption strategy
- **Budget forecasting**: ML-based predictions, seasonality
- **Commitment risk**: What happens if workloads change?

## Integration Points

- **Cloud providers**: AWS Cost Explorer, Azure Cost Management, GCP Billing
- **FinOps tools**: CloudHealth, Cloudability, Spot.io, Kubecost
- **Budget tools**: AWS Budgets, Azure Budgets, custom dashboards
- **Alerting**: Slack, PagerDuty, email
- **Reporting**: Tableau, Power BI, custom reports
- **Infrastructure**: Terraform, CloudFormation (tag enforcement)

## Output

### FinOps Summary

```
FINOPS MONTHLY REPORT — February 2024
═══════════════════════════════════════

Total cloud spend: $45,900 (vs budget $47,500: -3%)
Savings identified: $18,400/month (40% of current spend)
  Right-sizing: $3,300
  RI/Savings Plans: $6,600
  Waste elimination: $2,800
  Spot adoption: $2,800
  Storage optimization: $1,400
  Database optimization: $1,300

Commitment coverage: 45% (target: 75%)
Anomalies detected: 5 (all resolved)
Tag compliance: 94% (target: 100%)

ROI on optimization effort: 12x (1 person-month → $220K annualized)
```
