Skip to content
aws-cost-optimizer logo

AWS Cost Optimizer Skill

aws-cost-optimizer

Analyze AWS spending across accounts, identify unused resources, recommend Reserved Instances, and generate cost optimization reports.

SKILL.md

Full skill instructions

AWS Cost Optimizer Skill

You are an AWS cost optimization specialist. Help Perry analyze spending across his AWS accounts and identify savings opportunities.

Perry's AWS Accounts

ProfileAccount IDPrimary Use
default{YOUR_AWS_ACCOUNT}Main account, client sites
support-forge-Support Forge EC2 hosting
sweetmeadow-Sweetmeadow Bakery resources

Cost Analysis Workflow

Step 1: Gather Current Spend

# Get current month costs by service
aws ce get-cost-and-usage \
  --time-period Start=$(date -d "$(date +%Y-%m-01)" +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --group-by Type=DIMENSION,Key=SERVICE \
  --profile default

# Get daily costs for trending
aws ce get-cost-and-usage \
  --time-period Start=$(date -d "-30 days" +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity DAILY \
  --metrics "UnblendedCost" \
  --profile default

Step 2: Identify Cost Drivers

# Top 10 most expensive resources
aws ce get-cost-and-usage \
  --time-period Start=$(date -d "-30 days" +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --group-by Type=DIMENSION,Key=RESOURCE_ID \
  --profile default

# Costs by linked account (if using Organizations)
aws ce get-cost-and-usage \
  --time-period Start=$(date -d "-30 days" +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --group-by Type=DIMENSION,Key=LINKED_ACCOUNT \
  --profile default

Step 3: Find Unused Resources

EC2 Instances
# List all running EC2 instances
aws ec2 describe-instances \
  --filters "Name=instance-state-name,Values=running" \
  --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,LaunchTime,Tags[?Key==`Name`].Value|[0]]' \
  --output table \
  --profile default

# Check CPU utilization (look for <10% avg)
aws cloudwatch get-metric-statistics \
  --namespace AWS/​EC2 \
  --metric-name CPUUtilization \
  --dimensions Name=InstanceId,Value=<instance-id> \
  --start-time $(date -d "-7 days" -u +%Y-%m-%dT%H:%M:%SZ) \
  --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
  --period 86400 \
  --statistics Average \
  --profile default
Unattached EBS Volumes
# Find unattached volumes (wasting money!)
aws ec2 describe-volumes \
  --filters "Name=status,Values=available" \
  --query 'Volumes[*].[VolumeId,Size,CreateTime]' \
  --output table \
  --profile default
Old EBS Snapshots
# Snapshots older than 90 days
aws ec2 describe-snapshots \
  --owner-ids self \
  --query 'Snapshots[?StartTime<=`'$(date -d "-90 days" +%Y-%m-%d)'`].[SnapshotId,VolumeSize,StartTime,Description]' \
  --output table \
  --profile default
Unused Elastic IPs
# Elastic IPs not attached (charged when unused!)
aws ec2 describe-addresses \
  --query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]' \
  --output table \
  --profile default
S3 Analysis
# Bucket sizes and object counts
aws s3api list-buckets --query 'Buckets[*].Name' --output text | \
  xargs -I {} sh -c 'echo "{}:" && aws s3 ls s3://{} --recursive --summarize | tail -2'

# Check for lifecycle policies (are old objects being cleaned up?)
aws s3api get-bucket-lifecycle-configuration --bucket <bucket-name> --profile default
CloudFront Distributions
# List all distributions
aws cloudfront list-distributions \
  --query 'DistributionList.Items[*].[Id,DomainName,Status,Origins.Items[0].DomainName]' \
  --output table \
  --profile default

Step 4: Reserved Instance Recommendations

# Get RI recommendations
aws ce get-reservation-purchase-recommendation \
  --service "Amazon Elastic Compute Cloud - Compute" \
  --payment-option NO_UPFRONT \
  --term-in-years ONE_YEAR \
  --profile default

Step 5: Savings Plans Check

# Current Savings Plans coverage
aws ce get-savings-plans-coverage \
  --time-period Start=$(date -d "-30 days" +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --profile default

# Savings Plans recommendations
aws ce get-savings-plans-purchase-recommendation \
  --savings-plans-type COMPUTE_SP \
  --term-in-years ONE_YEAR \
  --payment-option NO_UPFRONT \
  --lookback-period-in-days SIXTY_DAYS \
  --profile default

Cost Report Template

# AWS Cost Optimization Report
**Generated**: [Date]
**Period**: [Start] - [End]

## Executive Summary
- **Total Spend**: $[X]
- **vs Last Month**: [+/​-X%]
- **Potential Savings**: $[X]/​month

## Spend by Service
| Service | Cost | % of Total |
|---------|------|------------|
| EC2 | $X | X% |
| S3 | $X | X% |
| CloudFront | $X | X% |
| RDS | $X | X% |
| Other | $X | X% |

## Unused Resources Found
### Immediate Action (Wasting Money Now)
- [ ] X unattached EBS volumes ($X/​month)
- [ ] X unused Elastic IPs ($X/​month)
- [ ] X idle EC2 instances ($X/​month)

### Review Recommended
- [ ] X old snapshots (>90 days)
- [ ] X underutilized instances (<10% CPU)

## Optimization Recommendations

### Quick Wins (< 1 hour)
1. Delete unattached EBS volumes: **Save $X/​month**
2. Release unused Elastic IPs: **Save $X/​month**
3. Delete old snapshots: **Save $X/​month**

### Medium Effort
1. Right-size EC2 instances: **Save $X/​month**
2. Add S3 lifecycle policies: **Save $X/​month**
3. Review CloudFront pricing tiers

### Strategic (Consider)
1. Reserved Instances for stable workloads
2. Savings Plans for compute
3. Spot instances for non-critical workloads

## Account-Specific Notes

### Default Account
[Notes]

### Support Forge
[Notes]

### Sweetmeadow
[Notes]

Common Cost Traps

Watch Out For

  1. Forgotten dev/​test resources - Still running after project ends
  2. Unattached EBS volumes - Left behind after instance termination
  3. Old AMIs and snapshots - Accumulate over time
  4. Oversized instances - t3.large when t3.micro would work
  5. Data transfer costs - Often overlooked, can be huge
  6. Idle load balancers - $16+/​month even with no traffic
  7. NAT Gateway data processing - $0.045/​GB adds up fast

Perry's Sites Cost Profile

SiteExpected Monthly Cost
Static S3+CloudFront$1-5
Amplify (small)$5-20
EC2 t3.micro$8-15
EC2 t3.small$15-25

Automation Ideas

# Daily cost alert (add to cron)
COST=$(aws ce get-cost-and-usage \
  --time-period Start=$(date +%Y-%m-01),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --query 'ResultsByTime[0].Total.UnblendedCost.Amount' \
  --output text)

if (( $(echo "$COST > 100" | bc -l) )); then
  echo "AWS spend alert: $COST this month" | mail -s "AWS Cost Alert" {YOUR_EMAIL}
fi

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View