aws-cost-optimizer
Comprehensive AWS cost analysis and optimization recommendations using AWS CLI and Cost Explorer
What this skill does
# AWS Cost Optimizer Analyze AWS spending patterns, identify waste, and provide actionable cost reduction strategies. ## When to Use This Skill Use this skill when you need to analyze AWS spending, identify cost optimization opportunities, or reduce cloud waste. ## Core Capabilities **Cost Analysis** - Parse AWS Cost Explorer data for trends and anomalies - Break down costs by service, region, and resource tags - Identify month-over-month spending increases **Resource Optimization** - Detect idle EC2 instances (low CPU utilization) - Find unattached EBS volumes and old snapshots - Identify unused Elastic IPs - Locate underutilized RDS instances - Find old S3 objects eligible for lifecycle policies **Savings Recommendations** - Suggest Reserved Instance/Savings Plans opportunities - Recommend instance rightsizing based on CloudWatch metrics - Identify resources in expensive regions - Calculate potential savings with specific actions ## AWS CLI Commands ### Get Cost and Usage ```bash # Last 30 days cost by service aws ce get-cost-and-usage \ --time-period Start=$(date -d '30 days ago' +%Y-%m-%d),End=$(date +%Y-%m-%d) \ --granularity MONTHLY \ --metrics BlendedCost \ --group-by Type=DIMENSION,Key=SERVICE # Daily costs for current month aws ce get-cost-and-usage \ --time-period Start=$(date +%Y-%m-01),End=$(date +%Y-%m-%d) \ --granularity DAILY \ --metrics UnblendedCost ``` ### Find Unused Resources ```bash # Unattached EBS volumes aws ec2 describe-volumes \ --filters Name=status,Values=available \ --query 'Volumes[*].[VolumeId,Size,VolumeType,CreateTime]' \ --output table # Unused Elastic IPs aws ec2 describe-addresses \ --query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]' \ --output table # Idle EC2 instances (requires CloudWatch) aws cloudwatch get-metric-statistics \ --namespace AWS/EC2 \ --metric-name CPUUtilization \ --dimensions Name=InstanceId,Value=i-xxxxx \ --start-time $(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%S) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \ --period 86400 \ --statistics Average # Old EBS snapshots (>90 days) aws ec2 describe-snapshots \ --owner-ids self \ --query 'Snapshots[?StartTime<=`'$(date -d '90 days ago' --iso-8601)'`].[SnapshotId,StartTime,VolumeSize]' \ --output table ``` ### Rightsizing Analysis ```bash # List EC2 instances with their types aws ec2 describe-instances \ --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name,Tags[?Key==`Name`].Value|[0]]' \ --output table # Get RDS instance utilization aws cloudwatch get-metric-statistics \ --namespace AWS/RDS \ --metric-name CPUUtilization \ --dimensions Name=DBInstanceIdentifier,Value=mydb \ --start-time $(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \ --period 86400 \ --statistics Average,Maximum ``` ## Optimization Workflow 1. **Baseline Assessment** - Pull 3-6 months of cost data - Identify top 5 spending services - Calculate growth rate 2. **Quick Wins** - Delete unattached EBS volumes - Release unused Elastic IPs - Stop/terminate idle EC2 instances - Delete old snapshots 3. **Strategic Optimization** - Analyze Reserved Instance coverage - Review instance types vs. workload - Implement S3 lifecycle policies - Consider Spot instances for non-critical workloads 4. **Ongoing Monitoring** - Set up AWS Budgets with alerts - Enable Cost Anomaly Detection - Tag resources for cost allocation - Monthly cost review meetings ## Cost Optimization Checklist - [ ] Enable AWS Cost Explorer - [ ] Set up cost allocation tags - [ ] Create AWS Budget with alerts - [ ] Review and delete unused resources - [ ] Analyze Reserved Instance opportunities - [ ] Implement S3 Intelligent-Tiering - [ ] Review data transfer costs - [ ] Optimize Lambda memory allocation - [ ] Use CloudWatch Logs retention policies - [ ] Consider multi-region cost differences ## Example Prompts **Analysis** - "Show me AWS costs for the last 3 months broken down by service" - "What are my top 10 most expensive resources?" - "Compare this month's spending to last month" **Optimization** - "Find all unattached EBS volumes and calculate savings" - "Identify EC2 instances with <5% CPU utilization" - "Suggest Reserved Instance purchases based on usage" - "Calculate savings from deleting snapshots older than 90 days" **Implementation** - "Create a script to delete unattached volumes" - "Set up a budget alert for $1000/month" - "Generate a cost optimization report for leadership" ## Best Practices - Always test in non-production first - Verify resources are truly unused before deletion - Document all cost optimization actions - Calculate ROI for optimization efforts - Automate recurring optimization tasks - Use AWS Trusted Advisor recommendations - Enable AWS Cost Anomaly Detection ## Integration with Kiro CLI This skill works seamlessly with Kiro CLI's AWS integration: ```bash # Use Kiro to analyze costs kiro-cli chat "Use aws-cost-optimizer to analyze my spending" # Generate optimization report kiro-cli chat "Create a cost optimization plan using aws-cost-optimizer" ``` ## Safety Notes - **Risk Level: Low** - Read-only analysis is safe - **Deletion Actions: Medium Risk** - Always verify before deleting resources - **Production Changes: High Risk** - Test rightsizing in dev/staging first - Maintain backups before any deletion - Use `--dry-run` flag when available ## Additional Resources - [AWS Cost Optimization Best Practices](https://aws.amazon.com/pricing/cost-optimization/) - [AWS Well-Architected Framework - Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html) - [AWS Cost Explorer API](https://docs.aws.amazon.com/cost-management/latest/APIReference/Welcome.html) ## Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.