Skip to main content
ClaudeWave
Skill279 estrellas del repoactualizado 7d ago

aws-cost-optimization

This Claude Code skill provides structured AWS cost optimization guidance organized around five pillars (right-sizing, elasticity, pricing models, storage optimization, monitoring) with twelve actionable best practices and AWS CLI examples. Use it when reviewing AWS spending, identifying unused resources, implementing FinOps practices, reducing compute or storage bills, selecting pricing models, configuring AWS cost management tools, or conducting AWS Well-Architected Framework cost reviews.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit /tmp/aws-cost-optimization && cp -r /tmp/aws-cost-optimization/plugins/developer-kit-aws/skills/aws/aws-cost-optimization ~/.claude/skills/aws-cost-optimization
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# AWS Cost Optimization

## Overview

Guide a structured AWS cost review covering right-sizing, elasticity, pricing models, storage optimization, and continuous monitoring. References AWS native tools (Cost Explorer, Budgets, Compute Optimizer, Trusted Advisor, Cost Anomaly Detection) and delivers twelve prioritized best practices organized under five optimization pillars. All examples use the AWS CLI.

## When to Use

- Optimizing AWS costs or reviewing AWS spending
- Finding unused or under-utilized AWS resources
- Implementing FinOps practices for cloud cost governance
- Reducing EC2, EBS, S3, or load balancer bills
- Choosing between On-Demand, Spot, Reserved Instances, and Savings Plans
- Configuring AWS Budgets, Cost Explorer, or Cost Anomaly Detection
- Performing an AWS Well-Architected Framework cost pillar review
- Cleaning up orphaned EBS snapshots or unused volumes
- Automating start/stop schedules for non-production workloads

Trigger: "Optimize my AWS costs", "Review AWS spending", "Find unused AWS resources", "Help me with FinOps", "Reduce my EC2 bill", "Clean up unused EBS volumes", "Set up AWS Budgets"

## Instructions

### Five Optimization Pillars

Work through each pillar in order during a cost review.

#### Pillar 1 — Right-Size

Match provisioned resources to actual workload needs.

1. Pull 14-day average CPU/memory metrics from CloudWatch for every EC2 instance
2. Cross-reference with AWS Compute Optimizer recommendations
3. Flag instances where peak utilization stays below 40%
4. Recommend downsizing to the next smaller instance family/size
5. For RDS, check read/write IOPS vs. provisioned capacity

#### Pillar 2 — Increase Elasticity

Schedule instance stop/start and leverage Auto Scaling Groups.

1. Identify non-production instances running 24/7 (dev, staging, QA)
2. Propose stop/start schedules using AWS Instance Scheduler or EventBridge rules
3. Review Auto Scaling Group policies for over-provisioned min/desired counts
4. Recommend target-tracking scaling policies tied to actual demand metrics
5. Consider Lambda or Fargate for bursty, event-driven workloads

#### Pillar 3 — Leverage the Right Pricing Model

Choose the optimal mix of On-Demand, Spot, Reserved Instances, and Savings Plans.

1. Analyze steady-state baseline using Cost Explorer RI Coverage and Savings Plans Coverage reports
2. Recommend Compute Savings Plans for consistent baseline compute
3. Suggest Spot Instances for fault-tolerant, stateless workloads (batch, CI/CD runners)
4. Evaluate existing Reserved Instances for utilization; resell unused RIs on the RI Marketplace
5. Use the AWS Pricing Calculator to model total cost under each pricing option

#### Pillar 4 — Optimize Storage

Eliminate waste in EBS, S3, and snapshots.

1. List unattached EBS volumes (`available` state) and recommend deletion after backup review
2. Identify orphaned EBS snapshots no longer linked to an active AMI or volume
3. Review S3 bucket metrics; recommend Intelligent-Tiering or lifecycle rules for infrequent access data
4. Enable Amazon Data Lifecycle Manager (DLM) for automated snapshot retention
5. Check for gp2 volumes that should be migrated to gp3 for cost and performance gains

#### Pillar 5 — Measure, Monitor, and Improve

Establish continuous cost governance.

1. Implement a cost allocation tagging strategy (e.g., `Environment`, `Team`, `Project`, `CostCenter`)
2. Configure AWS Budgets with threshold alerts (50%, 80%, 100%, forecasted)
3. Enable AWS Cost Anomaly Detection for automatic spend anomaly alerts
4. Set up a monthly Cost Explorer saved report for leadership review
5. Create a Trusted Advisor check schedule for cost optimization recommendations

### Review Process

Follow this structured flow when the user asks for a cost review:

1. **Scope** — Ask which AWS accounts, regions, and services to review
2. **Data Gathering** — Pull Cost Explorer data for the last 30–90 days; identify top-5 cost drivers
3. **Pillar Walk-Through** — Evaluate each of the five pillars in order
4. **Checklist** — Present the twelve best practices as a scored checklist (done / not done / partial)
5. **Quick Wins** — Highlight the three highest-impact, lowest-effort actions
6. **Roadmap** — Propose a 30/60/90-day optimization plan with estimated savings

## Examples

### Example 1 — List Unattached EBS Volumes

User: "Find unused EBS volumes in my account."

CLI commands to include in the response:

```bash
# List all EBS volumes in available (unattached) state
aws ec2 describe-volumes \
  --filters Name=status,Values=available \
  --query 'Volumes[*].{VolumeId:VolumeId,Size:Size,Type:VolumeType,Zone:AvailabilityZone,CreateTime:CreateTime}' \
  --output table

# Get monthly cost estimate for unused volumes (approx $0.08/GB/mo for gp3)
aws ec2 describe-volumes \
  --filters Name=status,Values=available \
  --query 'length(Volumes[*].[VolumeId,Size])' \
  --output text

# List orphaned snapshots (not linked to any AMI)
aws ec2 describe-snapshots \
  --owner-ids self \
  --query 'Snapshots[?!contains(Description, `ami-`)].[SnapshotId,VolumeId,StartTime,Size]'
```

### Example 2 — EC2 Right-Sizing with Compute Optimizer

User: "How can I reduce my EC2 bill?"

CLI commands to include in the response:

```bash
# Get Compute Optimizer right-sizing recommendations for EC2
aws compute-optimizer get-ec2-instance-recommendations \
  --query 'instanceRecommendations[*].{InstanceArn:instanceArn,CurrentInstanceType:currentInstanceType,RecommendedInstanceType:recommendations[0].instanceType,MonthlySaving:recommendations[0].estimatedMonthlySavings.value}' \
  --output table

# Pull average CPU utilization for an instance over 14 days
aws cloudwatch get-metric-statistics \
  --namespace AWS/EC2 \
  --metric-name CPUUtilization \
  --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
  --start-time 2026-03-09T00:00:00Z \
  --end-time 2026-03-23T00:00:00Z \
  --period 86400 \
  --statistics Average \
  --output table

# List all running ins
chunking-strategySkill

Provides chunking strategies for RAG systems. Generates chunk size recommendations (256-1024 tokens), overlap percentages (10-20%), and semantic boundary detection methods. Validates semantic coherence and evaluates retrieval precision/recall metrics. Use when building retrieval-augmented generation systems, vector databases, or processing large documents.

prompt-engineeringSkill

>

ragSkill

Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation systems. Use when building RAG applications, creating document Q&A systems, or integrating AI with knowledge bases.

aws-cloudformation-auto-scalingSkill

Provides AWS CloudFormation patterns for Auto Scaling including EC2, ECS, and Lambda. Use when creating Auto Scaling groups, launch configurations, launch templates, scaling policies, lifecycle hooks, and predictive scaling. Covers template structure with Parameters, Outputs, Mappings, Conditions, cross-stack references, and best practices for high availability and cost optimization.

aws-cloudformation-bedrockSkill

Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails, prompts, flows, and inference profiles. Use when creating Bedrock agents with action groups, implementing RAG with knowledge bases, configuring vector stores, setting up content moderation guardrails, managing prompts, orchestrating workflows with flows, and configuring inference profiles for model optimization.

aws-cloudformation-cloudfrontSkill

Provides AWS CloudFormation patterns for CloudFront distributions, origins (ALB, S3, Lambda@Edge, VPC Origins), CacheBehaviors, Functions, SecurityHeaders, parameters, Outputs and cross-stack references. Use when creating CloudFront distributions with CloudFormation, configuring multiple origins, implementing caching strategies, managing custom domains with ACM, configuring WAF, and optimizing performance.

aws-cloudformation-cloudwatchSkill

Provides AWS CloudFormation patterns for CloudWatch monitoring, metrics, alarms, dashboards, logs, and observability. Use when creating CloudWatch metrics, alarms, dashboards, log groups, log subscriptions, anomaly detection, synthesized canaries, Application Signals, and implementing template structure with Parameters, Outputs, Mappings, Conditions, cross-stack references, and CloudWatch best practices for monitoring production infrastructure.

aws-cloudformation-dynamodbSkill

Provides AWS CloudFormation patterns for DynamoDB tables, GSIs, LSIs, auto-scaling, and streams. Use when creating DynamoDB tables with CloudFormation, configuring primary keys, local/global secondary indexes, capacity modes (on-demand/provisioned), point-in-time recovery, encryption, TTL, and implementing template structure with Parameters, Outputs, Mappings, Conditions, cross-stack references.