Skip to main content

FinOps Concepts

What is FinOps?​

FinOps (Financial Operations) is a cultural practice and discipline that maximizes the business value of the cloud by helping engineering, finance, and business teams collaborate on cloud spending decisions.

┌─────────────────────────────────────────────────────────────┐
│ FINOPS - THE 3 PHASES │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 1. INFORM 2. OPTIMIZE │ │
│ │ ───────── ────────── │ │
│ │ • Cost visibility • Right-sizing │ │
│ │ • Allocation • Reserved/Savings │ │
│ │ • Budgets • Spot instances │ │
│ │ • Forecasting • Cleanup │ │
│ │ │ │
│ │ ↓ │ │
│ │ │ │
│ │ 3. OPERATE │ │
│ │ ───────── │ │
│ │ • Governance │ │
│ │ • Automation │ │
│ │ • Continuous improvement │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

AWS Cost Explorer​

┌─────────────────────────────────────────────────────────────┐
│ AWS COST EXPLORER │
├─────────────────────────────────────────────────────────────┤
│ │
│ MAIN VIEWS: │
│ │
│ 1. BY SERVICE │
│ ┌─────────────────────────────────────────────────┐ │
│ │ EC2 ████████████████████ $1,200 (40%)│ │
│ │ RDS ██████████ $600 (20%) │ │
│ │ S3 ████████ $450 (15%) │ │
│ │ Lambda ██████ $300 (10%) │ │
│ │ Other █████ $450 (15%) │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ 2. BY TAG │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Env:Production ██████████████████ $2,100 │ │
│ │ Env:Staging ████████ $600 │ │
│ │ Env:Dev ████ $300 │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ 3. BY ACCOUNT │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Prod Account ██████████████████ $2,100 │ │
│ │ Dev Account ████████ $600 │ │
│ │ Shared Services ████ $300 │ │
│ └─────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

Tagging Strategy​

Essential Tags​

┌─────────────────────────────────────────────────────────────┐
│ TAGGING STRATEGY │
├─────────────────────────────────────────────────────────────┤
│ │
│ MANDATORY TAGS: │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Tag Example Values Purpose │ │
│ │ ─── ─────────────── ─── │ │
│ │ Environment prod/staging/dev Environment │ │
│ │ Project webapp/api/batch Project │ │
│ │ Owner team-infra Responsible │ │
│ │ CostCenter CC-1234 Billing │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ RECOMMENDED TAGS: │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Application app-name Identification │ │
│ │ CreatedBy terraform/console Traceability │ │
│ │ ExpiryDate 2024-12-31 Cleanup │ │
│ │ Compliance pci/hipaa Compliance │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ COMPLETE EXAMPLE: │
│ { │
│ "Environment": "production", │
│ "Project": "ecommerce-api", │
│ "Owner": "team-backend", │
│ "CostCenter": "CC-5678", │
│ "Application": "checkout-service", │
│ "CreatedBy": "terraform" │
│ } │
│ │
└─────────────────────────────────────────────────────────────┘

Tag Enforcement​

# AWS Config Rule to check mandatory tags
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "required-tags-ec2",
"Source": {
"Owner": "AWS",
"SourceIdentifier": "REQUIRED_TAGS"
},
"InputParameters": "{\"tag1Key\":\"Environment\",\"tag2Key\":\"Project\",\"tag3Key\":\"Owner\"}",
"Scope": {
"ComplianceResourceTypes": ["AWS::EC2::Instance"]
}
}'

Right-Sizing​

Identifying Over-Provisioned Resources​

┌─────────────────────────────────────────────────────────────┐
│ RIGHT-SIZING │
├─────────────────────────────────────────────────────────────┤
│ │
│ METRICS TO ANALYZE: │
│ │
│ Average CPU Utilization < 20% │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Instance CPU Avg RAM Avg Recommendation │ │
│ │ ──────── ─────── ─────── ────────────── │ │
│ │ i-web1 15% 30% Reduce │ │
│ │ i-web2 45% 60% OK │ │
│ │ i-db1 80% 85% Increase? │ │
│ │ i-batch 5% 10% Spot or smaller │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ RULES OF THUMB: │
│ │
│ CPU < 20% for 14+ days → Candidate for downsizing │
│ CPU > 80% frequently → Candidate for upsizing │
│ Memory < 30% → Likely over-provisioned │
│ │
│ AWS COMPUTE OPTIMIZER: │
│ Free service that automatically analyzes and │
│ recommends the right instance types │
│ │
└─────────────────────────────────────────────────────────────┘

Pricing Options​

Comparison​

┌─────────────────────────────────────────────────────────────┐
│ EC2 PRICING OPTIONS │
├─────────────────────────────────────────────────────────────┤
│ │
│ TYPE SAVINGS COMMITMENT USE CASES │
│ ──── ──────── ────────── ─────────── │
│ │
│ On-Demand 0% None Dev, tests │
│ (on demand) Unexpected peaks│
│ │
│ Reserved (RI) 30-60% 1-3 years Stable │
│ Standard Fixed type production │
│ │
│ Reserved (RI) 20-40% 1-3 years Scalable │
│ Convertible Flexible production │
│ │
│ Savings Plans 30-50% 1-3 years Compute │
│ Compute Flexible multi-service │
│ │
│ Spot 60-90% None Batch, CI/CD │
│ Instances Interruptible Tolerant │
│ │
│ EXAMPLE ANNUAL SAVINGS (m5.large in us-east-1): │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ On-Demand : $0.096/h × 8760h = $840/year │ │
│ │ 1yr RI : $0.060/h × 8760h = $525/year (-37%) │ │
│ │ 3yr RI : $0.040/h × 8760h = $350/year (-58%) │ │
│ │ Spot : ~$0.030/h × 8760h = $263/year (-69%) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

Resource Cleanup​

Commonly Forgotten Resources​

┌─────────────────────────────────────────────────────────────┐
│ ORPHANED RESOURCES │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. UNATTACHED EBS VOLUMES │
│ aws ec2 describe-volumes \ │
│ --filters Name=status,Values=available │
│ → Delete or snapshot and delete │
│ │
│ 2. UNUSED ELASTIC IPs │
│ aws ec2 describe-addresses \ │
│ --filters Name=association-id,Values="" │
│ → Cost: $3.65/month if not attached! │
│ │
│ 3. OLD SNAPSHOTS │
│ aws ec2 describe-snapshots --owner-ids self \ │
│ --query 'Snapshots[?StartTime<`2023-01-01`]' │
│ → Evaluate and delete obsolete ones │
│ │
│ 4. OLD AMIs │
│ Keep only N latest versions │
│ │
│ 5. UNUSED LOAD BALANCERS │
│ ALB/NLB without targets │
│ → Fixed cost even without traffic │
│ │
│ 6. UNDERUTILIZED NAT GATEWAYS │
│ → $32/month minimum + data │
│ Consider NAT Instance for dev │
│ │
│ 7. STOPPED RDS INSTANCES │
│ ⚠️ Automatically restart after 7 days! │
│ → Snapshot and delete if not needed │
│ │
└─────────────────────────────────────────────────────────────┘

Cleanup Script​

#!/bin/bash
# cleanup-orphans.sh

echo "=== Searching for orphaned resources ==="

echo -e "\n1. Unattached EBS Volumes:"
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query 'Volumes[*].[VolumeId,Size,CreateTime]' \
--output table

echo -e "\n2. Unused Elastic IPs:"
aws ec2 describe-addresses \
--query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]' \
--output table

echo -e "\n3. Snapshots > 90 days:"
NINETY_DAYS_AGO=$(date -d '90 days ago' '+%Y-%m-%d')
aws ec2 describe-snapshots --owner-ids self \
--query "Snapshots[?StartTime<'${NINETY_DAYS_AGO}'].[SnapshotId,VolumeSize,StartTime]" \
--output table

echo -e "\n4. Load Balancers without targets:"
for alb in $(aws elbv2 describe-load-balancers --query 'LoadBalancers[*].LoadBalancerArn' --output text); do
targets=$(aws elbv2 describe-target-groups --load-balancer-arn $alb --query 'TargetGroups[*].TargetGroupArn' --output text)
if [ -z "$targets" ]; then
echo "ALB without targets: $alb"
fi
done

echo -e "\n=== Analysis complete ==="

AWS Budgets​

Configuration​

┌─────────────────────────────────────────────────────────────┐
│ AWS BUDGETS │
├─────────────────────────────────────────────────────────────┤
│ │
│ TYPES OF BUDGETS: │
│ │
│ • Cost Budget: Spending limit │
│ • Usage Budget: Usage limit (hours, GB) │
│ • Reservation Budget: RI/Savings Plans coverage │
│ │
│ CONFIGURATION EXAMPLE: │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Budget Name: Monthly-Production │ │
│ │ Amount: $5,000 │ │
│ │ Period: Monthly │ │
│ │ │ │
│ │ Alerts: │ │
│ │ • 50% ($2,500) → Email info │ │
│ │ • 80% ($4,000) → Email warning │ │
│ │ • 100% ($5,000) → Email + SMS │ │
│ │ • 110% forecasted → Email alert │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
# Create a budget
aws budgets create-budget \
--account-id 123456789012 \
--budget '{
"BudgetName": "Monthly-Limit",
"BudgetLimit": {
"Amount": "5000",
"Unit": "USD"
},
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}' \
--notifications-with-subscribers '[{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80
},
"Subscribers": [{
"SubscriptionType": "EMAIL",
"Address": "team@example.com"
}]
}]'

Summary of Recommendations​

DomainActionPotential Savings
TaggingImplement mandatory tagsVisibility
Right-sizingReduce underutilized instances20-40%
Reserved/SPCommit to stable load30-60%
SpotUse for flexible workloads60-90%
CleanupRemove orphaned resources10-20%
BudgetsProactive alertsControl

Next section: FinOps Lab