
aws-cost-finops
AWS cost optimization and FinOps workflows. Use for finding unused resources, analyzing Reserved Instance opportunities, detecting cost anomalies, rightsizing instances, evaluating Spot instances, migrating to newer generation instances, implementing FinOps best practices, optimizing storage/network/database costs, and managing cloud financial operations. Includes automated analysis scripts and comprehensive reference documentation.
- Installs
- 105
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/ahmedasmar/devops-claude-skills --skill aws-cost-finops- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads aws-cost-finops automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
AWS Cost Optimization & FinOps
Systematic workflows for AWS cost optimization and financial operations management.
When to Use This Skill
Use this skill when you need to:
- Find cost savings: Identify unused resources, rightsizing opportunities, or commitment discounts
- Analyze spending: Understand cost trends, detect anomalies, or break down costs
- Optimize architecture: Choose cost-effective services, storage tiers, or instance types
- Implement FinOps: Set up governance, tagging, budgets, or monthly reviews
- Make purchase decisions: Evaluate Reserved Instances, Savings Plans, or Spot instances
- Troubleshoot costs: Investigate unexpected bills or cost spikes
- Plan budgets: Forecast costs or evaluate impact of new projects
Cost Optimization Workflow
Follow this systematic approach for AWS cost optimization:
┌─────────────────────────────────────────────┐
│ 1. DISCOVER │
│ What are we spending money on? │
│ Run: find_unused_resources.py │
│ Run: cost_anomaly_detector.py │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 2. ANALYZE │
│ Where are the optimization opportunities?│
│ Run: rightsizing_analyzer.py │
│ Run: detect_old_generations.py │
│ Run: spot_recommendations.py │
│ Run: analyze_ri_recommendations.py │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 3. PRIORITIZE │
│ What should we optimize first? │
│ - Quick wins (low risk, high savings) │
│ - Low-hanging fruit (easy to implement) │
│ - Strategic improvements │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 4. IMPLEMENT │
│ Execute optimization actions │
│ - Delete unused resources │
│ - Rightsize instances │
│ - Purchase commitments │
│ - Migrate to new generations │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 5. MONITOR │
│ Verify savings and track metrics │
│ - Monthly cost reviews │
│ - Tag compliance monitoring │
│ - Budget variance tracking │
└─────────────────────────────────────────────┘
Core Workflows
Workflow 1: Monthly Cost Optimization Review
Frequency: Run monthly (first week of each month)
Step 1: Find Unused Resources
# Scan for waste across all resources
python3 scripts/find_unused_resources.py
# Expected output:
# - Unattached EBS volumes
# - Old snapshots
# - Unused Elastic IPs
# - Idle NAT Gateways
# - Idle EC2 instances
# - Unused load balancers
# - Estimated monthly savings
Step 2: Analyze Cost Anomalies
# Detect unusual spending patterns
python3 scripts/cost_anomaly_detector.py --days 30
# Expected output:
# - Cost spikes and anomalies
# - Top cost drivers
# - Period-over-period comparison
# - 30-day forecast
Step 3: Identify Rightsizing Opportunities
# Find oversized instances
python3 scripts/rightsizing_analyzer.py --days 30
# Expected output:
# - EC2 instances with low utilization
# - RDS instances with low utilization
# - Recommended smaller instance types
# - Estimated savings
Step 4: Generate Monthly Report
# Use the template to compile findings
cp assets/templates/monthly_cost_report.md reports/$(date +%Y-%m)-cost-report.md
# Fill in:
# - Findings from scripts
# - Action items
# - Team cost breakdowns
# - Optimization wins
Step 5: Team Review Meeting
- Present findings to engineering teams
- Assign optimization tasks
- Track action items to completion
Workflow 2: Commitment Purchase Analysis (RI/Savings Plans)
When: Quarterly or when usage patterns stabilize
Step 1: Analyze Current Usage
# Identify workloads suitable for commitments
python3 scripts/analyze_ri_recommendations.py --days 60
# Looks for:
# - EC2 instances running consistently for 60+ days
# - RDS instances with stable usage
# - Calculates ROI for 1yr vs 3yr commitments
Step 2: Review Recommendations
Evaluate each recommendation:
✅ Good candidate if:
- Running 24/7 for 60+ days
- Workload is stable and predictable
- No plans to change architecture
- Savings > 30%
❌ Poor candidate if:
- Workload is variable or experimental
- Architecture changes planned
- Instance type may change
- Dev/test environment
Step 3: Choose Commitment Type
Reserved Instances:
- Standard RI: Highest discount (63%), no flexibility
- Convertible RI: Moderate discount (54%), can change instance type
- Best for: Specific instance types, stable workloads
Savings Plans:
- Compute SP: Flexible across instance types, regions (66% savings)
- EC2 Instance SP: Flexible across sizes in same family (72% savings)
- Best for: Variable workloads within constraints
Decision Matrix:
Known instance type, won't change → Standard RI
May need to change types → Convertible RI or Compute SP
Variable workloads → Compute Savings Plan
Maximum flexibility → Compute Savings Plan
Step 4: Purchase and Track
- Purchase through AWS Console or CLI
- Tag commitments with purchase date and owner
- Monitor utilization monthly
- Aim for >90% utilization
Reference: See references/best_practices.md for detailed commitment strategies
Workflow 3: Instance Generation Migration
When: During architecture reviews or optimization sprints
Step 1: Detect Old Instances
# Find outdated instance generations
python3 scripts/detect_old_generations.py
# Identifies:
# - t2 → t3 migrations (10% savings)
# - m4 → m5 → m6i migrations
# - Intel → Graviton opportunities (20% savings)
Step 2: Prioritize Migrations
Quick Wins (Low Risk):
t2 → t3: Drop-in replacement, 10% savings
m4 → m5: Better performance, 5% savings
gp2 → gp3: No downtime, 20% savings
Medium Effort (Test Required):
x86 → Graviton (ARM64): 20% savings
- Requires ARM64 compatibility testing
- Most modern frameworks support ARM64
- Test in staging first
Step 3: Execute Migration
For EC2 (x86 to x86):
- Stop instance
- Change instance type
- Start instance
- Verify application
For Graviton Migration:
- Create ARM64 AMI or Docker image
- Launch new Graviton instance
- Test thoroughly
- Cut over traffic
- Terminate old instance
Step 4: Validate Savings
- Monitor new costs in Cost Explorer
- Verify performance is acceptable
- Document migration for other teams
Reference: See references/best_practices.md → Compute Optimization
Workflow 4: Spot Instance Evaluation
When: For fault-tolerant workloads or Auto Scaling Groups
Step 1: Identify Candidates
# Analyze workloads for Spot suitability
python3 scripts/spot_recommendations.py
# Evaluates:
# - Instances in Auto Scaling Groups (good candidates)
# - Dev/test/staging environments
# - Batch processing workloads
# - CI/CD and build servers
Step 2: Assess Suitability
Excellent for Spot:
- Stateless applications
- Batch jobs
- CI/CD pipelines
- Data processing
- Auto Scaling Groups
NOT suitable for Spot:
- Databases (without replicas)
- Stateful applications
- Real-time services
- Mission-critical workloads
Step 3: Implementation Strategy
Option 1: Fargate Spot (Easiest)
# ECS task definition
requiresCompatibilities:
- FARGATE
capacityProviderStrategy:
- capacityProvider: FARGATE_SPOT
weight: 70 # 70% Spot
- capacityProvider: FARGATE
weight: 30 # 30% On-Demand
Option 2: EC2 Auto Scaling with Spot
# Mixed instances policy
MixedInstancesPolicy:
InstancesDistribution:
OnDemandBaseCapacity: 2
OnDemandPercentageAboveBaseCapacity: 30
SpotAllocationStrategy: capacity-optimized
LaunchTemplate:
Overrides:
- InstanceType: m5.large
- InstanceType: m5a.large
- InstanceType: m5n.large
Option 3: EC2 Spot Fleet
# Create Spot Fleet with diverse instance types
aws ec2 request-spot-fleet --spot-fleet-request-config file://spot-fleet.json
Step 4: Implement Interruption Handling
# Handle 2-minute termination notice
# Instance metadata: /latest/meta-data/spot/instance-action
# In application:
1. Poll for termination notice
2. Gracefully shutdown (save state)
3. Drain connections
4. Exit
Reference: See references/best_practices.md → Compute Optimization → Spot Instances
Quick Reference: Cost Optimization Scripts
All Scripts Location
ls scripts/
# find_unused_resources.py
# analyze_ri_recommendations.py
# detect_old_generations.py
# spot_recommendations.py
# rightsizing_analyzer.py
# cost_anomaly_detector.py
Script Usage Patterns
Monthly Review (Run all):
python3 scripts/find_unused_resources.py
python3 scripts/cost_anomaly_detector.py --days 30
python3 scripts/rightsizing_analyzer.py --days 30
Quarterly Optimization:
python3 scripts/analyze_ri_recommendations.py --days 60
python3 scripts/detect_old_generations.py
python3 scripts/spot_recommendations.py
Specific Region Only:
python3 scripts/find_unused_resources.py --region us-east-1
python3 scripts/rightsizing_analyzer.py --region us-west-2
Named AWS Profile:
python3 scripts/find_unused_resources.py --profile production
python3 scripts/cost_anomaly_detector.py --profile production --days 60
Script Requirements
# Install dependencies
pip install boto3 tabulate
# AWS credentials required
# Configure via: aws configure
# Or use: --profile PROFILE_NAME
Service-Specific Optimization
Compute Optimization
Key Actions:
- Migrate to Graviton (20% savings)
- Use Spot for fault-tolerant workloads (70% savings)
- Purchase RIs for stable workloads (40-65% savings)
- Right-size oversized instances
Reference: references/best_practices.md → Compute Optimization
Storage Optimization
Key Actions:
- Convert gp2 → gp3 (20% savings)
- Implement S3 lifecycle policies (50-95% savings)
- Delete old snapshots
- Use S3 Intelligent-Tiering
Reference: references/best_practices.md → Storage Optimization
Network Optimization
Key Actions:
- Replace NAT Gateways with VPC Endpoints (save $25-30/month each)
- Use CloudFront to reduce data transfer costs
- Colocate resources in same AZ when possible
Reference: references/best_practices.md → Network Optimization
Database Optimization
Key Actions:
- Right-size RDS instances
- Use gp3 storage (20% cheaper than gp2)
- Evaluate Aurora Serverless for variable workloads
- Purchase RDS Reserved Instances
Reference: references/best_practices.md → Database Optimization
Service Alternatives Decision Guide
Need help choosing between services?
Question: "Should I use EC2, Lambda, or Fargate?"
Answer: See references/service_alternatives.md → Compute Alternatives
Question: "Which S3 storage class should I use?"
Answer: See references/service_alternatives.md → Storage Alternatives
Question: "Should I use RDS or Aurora?"
Answer: See references/service_alternatives.md → Database Alternatives
Question: "NAT Gateway vs VPC Endpoint vs NAT Instance?"
Answer: See references/service_alternatives.md → Networking Alternatives
FinOps Governance & Process
Setting Up FinOps
Phase 1: Foundation (Month 1)
- Enable Cost Explorer
- Set up AWS Budgets
- Define tagging strategy
- Activate cost allocation tags
Phase 2: Visibility (Months 2-3)
- Implement tagging enforcement
- Run optimization scripts
- Set up monthly reviews
- Create team cost reports
Phase 3: Culture (Ongoing)
- Cost metrics in engineering KPIs
- Cost review in architecture decisions
- Regular optimization sprints
- FinOps champions in each team
Full Guide: See references/finops_governance.md
Monthly Review Process
Week 1: Data Collection
- Run all optimization scripts
- Export Cost & Usage Reports
- Compile findings
Week 2: Analysis
- Identify trends
- Find opportunities
- Prioritize actions
Week 3: Team Reviews
- Present to engineering teams
- Discuss optimizations
- Assign action items
Week 4: Executive Reporting
- Create executive summary
- Forecast next quarter
- Report optimization wins
Template: See assets/templates/monthly_cost_report.md
Detailed Process: See references/finops_governance.md → Monthly Review Process
Cost Optimization Checklist
Quick Wins (Do First)
- Delete unattached EBS volumes
- Delete old EBS snapshots (>90 days)
- Release unused Elastic IPs
- Convert gp2 → gp3 volumes
- Stop/terminate idle EC2 instances
- Enable S3 Intelligent-Tiering
- Set up AWS Budgets and alerts
Medium Effort (This Quarter)
- Right-size oversized instances
- Migrate to newer instance generations
- Purchase Reserved Instances for stable workloads
- Implement S3 lifecycle policies
- Replace NAT Gateways with VPC Endpoints (where applicable)
- Enable automated resource scheduling (dev/test)
- Implement tagging strategy and enforcement
Strategic Initiatives (Ongoing)
- Migrate to Graviton instances
- Implement Spot for fault-tolerant workloads
- Establish monthly cost review process
- Set up cost allocation by team
- Implement chargeback/showback model
- Create FinOps culture and practices
Troubleshooting Cost Issues
"My bill suddenly increased"
-
Run cost anomaly detection:
python3 scripts/cost_anomaly_detector.py --days 30 -
Check Cost Explorer for service breakdown
-
Review CloudTrail for resource creation events
-
Check for AutoScaling events
-
Verify no Reserved Instances expired
"I need to reduce costs by X%"
Follow the optimization workflow:
- Run all discovery scripts
- Calculate total potential savings
- Prioritize by: Savings Amount × (1 / Effort)
- Focus on quick wins first
- Implement strategic changes for long-term
"How do I know if Reserved Instances make sense?"
Run RI analysis:
python3 scripts/analyze_ri_recommendations.py --days 60
Look for:
- Instances running 60+ days consistently
- Workloads that won't change
- Savings > 30%
"Which resources can I safely delete?"
Run unused resource finder:
python3 scripts/find_unused_resources.py
Safe to delete (usually):
- Unattached EBS volumes (after verifying)
- Snapshots > 90 days (if backups exist elsewhere)
- Unused Elastic IPs (after verifying not in DNS)
- Stopped EC2 instances > 30 days (after confirming abandoned)
Always verify with resource owner before deletion!
Best Practices Summary
- Tag Everything: Consistent tagging enables cost allocation and accountability
- Monitor Continuously: Weekly script runs catch waste early
- Review Monthly: Regular reviews prevent cost drift
- Right-size Proactively: Don't wait for cost issues to optimize
- Use Commitments Wisely: RIs/SPs for stable workloads only
- Test Before Migrating: Especially for Graviton or Spot
- Automate Cleanup: Scheduled shutdown of dev/test resources
- Share Wins: Celebrate cost savings to build FinOps culture
Additional Resources
Detailed References:
references/best_practices.md: Comprehensive optimization strategiesreferences/service_alternatives.md: Cost-effective service selectionreferences/finops_governance.md: Organizational FinOps practices
Templates:
assets/templates/monthly_cost_report.md: Monthly reporting template
Scripts:
- All scripts in
scripts/directory with--helpfor usage
AWS Documentation:
- AWS Cost Explorer: https://aws.amazon.com/aws-cost-management/aws-cost-explorer/
- AWS Budgets: https://aws.amazon.com/aws-cost-management/aws-budgets/
- FinOps Foundation: https://www.finops.org
FAQ
What does the aws-cost-finops skill do?
AWS cost optimization and FinOps workflows. Use for finding unused resources, analyzing Reserved Instance opportunities, detecting cost anomalies, rightsizing instances, evaluating Spot instances, migrating to newer generation instances, implementing FinOps best practices, optimizing storage/network/database costs, and managing cloud financial operations. Includes automated analysis scripts and comprehensive reference documentation.
How do I install aws-cost-finops?
Run npx skills add https://github.com/ahmedasmar/devops-claude-skills --skill aws-cost-finops in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/aws-cost-finops/ (personal) or .claude/skills/aws-cost-finops/ (project).
Which AI agents can use aws-cost-finops?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is aws-cost-finops safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains aws-cost-finops?
It is published by ahmedasmar in ahmedasmar/devops-claude-skills. It has 105 recorded installs.
More from ahmedasmar/devops-claude-skills
monitoring-observability
ahmedasmar/devops-claude-skills
Monitoring and observability strategy, implementation, and troubleshooting. Use this skill whenever the user mentions monitoring, observability, metrics, logs, traces, alerting, SLOs, Prometheus, Grafana, Datadog, Loki, or OpenTelemetry. Triggers include designing metrics strategy (Four Golden Signals, RED/USE), setting up Prometheus/Grafana/Loki, creating alerts or dashboards, calculating SLOs and error budgets, instrumenting with OpenTelemetry, analyzing performance issues, choosing between monitoring tools, optimizing Datadog costs, migrating to open-source stack, and setting up distributed tracing.
ci-cd
ahmedasmar/devops-claude-skills
CI/CD pipeline design, optimization, DevSecOps security scanning, and troubleshooting. Use this skill whenever the user mentions CI/CD, GitHub Actions, GitLab CI, pipelines, workflows, builds, or DevSecOps. Triggers include creating new CI/CD workflows, debugging pipeline failures or flaky tests, implementing SAST/DAST/SCA security scanning, optimizing slow builds with caching or parallelization, setting up deployment workflows, securing pipelines with OIDC or secrets management, implementing matrix builds or test sharding, and troubleshooting Docker, permissions, or timeout issues.
aws-cost-optimization
ahmedasmar/devops-claude-skills
Open the skill to read its SKILL.md instructions.
k8s-troubleshooter
ahmedasmar/devops-claude-skills
Open the skill to read its SKILL.md instructions.
gitops-workflows
ahmedasmar/devops-claude-skills
Open the skill to read its SKILL.md instructions.
iac-terraform
ahmedasmar/devops-claude-skills
Open the skill to read its SKILL.md instructions.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.