[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-4187ac09-a467-4647-b1c3-702420bf65f9":3,"$fur1agTVPIQ1asIJS1leCkKYlGj9ymI4vSo0RPNQj3n8":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"4187ac09-a467-4647-b1c3-702420bf65f9","aws-cost-optimizer","使用AWS CLI和成本探查器进行全面AWS成本分析和优化建议","cat_coding_devops","mod_coding","sickn33,coding","---\nname: aws-cost-optimizer\ndescription: \"Comprehensive AWS cost analysis and optimization recommendations using AWS CLI and Cost Explorer\"\nrisk: safe\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# AWS Cost Optimizer\n\nAnalyze AWS spending patterns, identify waste, and provide actionable cost reduction strategies.\n\n## When to Use This Skill\n\nUse this skill when you need to analyze AWS spending, identify cost optimization opportunities, or reduce cloud waste.\n\n## Core Capabilities\n\n**Cost Analysis**\n- Parse AWS Cost Explorer data for trends and anomalies\n- Break down costs by service, region, and resource tags\n- Identify month-over-month spending increases\n\n**Resource Optimization**\n- Detect idle EC2 instances (low CPU utilization)\n- Find unattached EBS volumes and old snapshots\n- Identify unused Elastic IPs\n- Locate underutilized RDS instances\n- Find old S3 objects eligible for lifecycle policies\n\n**Savings Recommendations**\n- Suggest Reserved Instance\u002FSavings Plans opportunities\n- Recommend instance rightsizing based on CloudWatch metrics\n- Identify resources in expensive regions\n- Calculate potential savings with specific actions\n\n## AWS CLI Commands\n\n### Get Cost and Usage\n```bash\n# Last 30 days cost by service\naws ce get-cost-and-usage \\\n  --time-period Start=$(date -d '30 days ago' +%Y-%m-%d),End=$(date +%Y-%m-%d) \\\n  --granularity MONTHLY \\\n  --metrics BlendedCost \\\n  --group-by Type=DIMENSION,Key=SERVICE\n\n# Daily costs for current month\naws ce get-cost-and-usage \\\n  --time-period Start=$(date +%Y-%m-01),End=$(date +%Y-%m-%d) \\\n  --granularity DAILY \\\n  --metrics UnblendedCost\n```\n\n### Find Unused Resources\n```bash\n# Unattached EBS volumes\naws ec2 describe-volumes \\\n  --filters Name=status,Values=available \\\n  --query 'Volumes[*].[VolumeId,Size,VolumeType,CreateTime]' \\\n  --output table\n\n# Unused Elastic IPs\naws ec2 describe-addresses \\\n  --query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]' \\\n  --output table\n\n# Idle EC2 instances (requires CloudWatch)\naws cloudwatch get-metric-statistics \\\n  --namespace AWS\u002FEC2 \\\n  --metric-name CPUUtilization \\\n  --dimensions Name=InstanceId,Value=i-xxxxx \\\n  --start-time $(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%S) \\\n  --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \\\n  --period 86400 \\\n  --statistics Average\n\n# Old EBS snapshots (>90 days)\naws ec2 describe-snapshots \\\n  --owner-ids self \\\n  --query 'Snapshots[?StartTime\u003C=`'$(date -d '90 days ago' --iso-8601)'`].[SnapshotId,StartTime,VolumeSize]' \\\n  --output table\n```\n\n### Rightsizing Analysis\n```bash\n# List EC2 instances with their types\naws ec2 describe-instances \\\n  --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name,Tags[?Key==`Name`].Value|[0]]' \\\n  --output table\n\n# Get RDS instance utilization\naws cloudwatch get-metric-statistics \\\n  --namespace AWS\u002FRDS \\\n  --metric-name CPUUtilization \\\n  --dimensions Name=DBInstanceIdentifier,Value=mydb \\\n  --start-time $(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S) \\\n  --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \\\n  --period 86400 \\\n  --statistics Average,Maximum\n```\n\n## Optimization Workflow\n\n1. **Baseline Assessment**\n   - Pull 3-6 months of cost data\n   - Identify top 5 spending services\n   - Calculate growth rate\n\n2. **Quick Wins**\n   - Delete unattached EBS volumes\n   - Release unused Elastic IPs\n   - Stop\u002Fterminate idle EC2 instances\n   - Delete old snapshots\n\n3. **Strategic Optimization**\n   - Analyze Reserved Instance coverage\n   - Review instance types vs. workload\n   - Implement S3 lifecycle policies\n   - Consider Spot instances for non-critical workloads\n\n4. **Ongoing Monitoring**\n   - Set up AWS Budgets with alerts\n   - Enable Cost Anomaly Detection\n   - Tag resources for cost allocation\n   - Monthly cost review meetings\n\n## Cost Optimization Checklist\n\n- [ ] Enable AWS Cost Explorer\n- [ ] Set up cost allocation tags\n- [ ] Create AWS Budget with alerts\n- [ ] Review and delete unused resources\n- [ ] Analyze Reserved Instance opportunities\n- [ ] Implement S3 Intelligent-Tiering\n- [ ] Review data transfer costs\n- [ ] Optimize Lambda memory allocation\n- [ ] Use CloudWatch Logs retention policies\n- [ ] Consider multi-region cost differences\n\n## Example Prompts\n\n**Analysis**\n- \"Show me AWS costs for the last 3 months broken down by service\"\n- \"What are my top 10 most expensive resources?\"\n- \"Compare this month's spending to last month\"\n\n**Optimization**\n- \"Find all unattached EBS volumes and calculate savings\"\n- \"Identify EC2 instances with \u003C5% CPU utilization\"\n- \"Suggest Reserved Instance purchases based on usage\"\n- \"Calculate savings from deleting snapshots older than 90 days\"\n\n**Implementation**\n- \"Create a script to delete unattached volumes\"\n- \"Set up a budget alert for $1000\u002Fmonth\"\n- \"Generate a cost optimization report for leadership\"\n\n## Best Practices\n\n- Always test in non-production first\n- Verify resources are truly unused before deletion\n- Document all cost optimization actions\n- Calculate ROI for optimization efforts\n- Automate recurring optimization tasks\n- Use AWS Trusted Advisor recommendations\n- Enable AWS Cost Anomaly Detection\n\n## Integration with Kiro CLI\n\nThis skill works seamlessly with Kiro CLI's AWS integration:\n\n```bash\n# Use Kiro to analyze costs\nkiro-cli chat \"Use aws-cost-optimizer to analyze my spending\"\n\n# Generate optimization report\nkiro-cli chat \"Create a cost optimization plan using aws-cost-optimizer\"\n```\n\n## Safety Notes\n\n- **Risk Level: Low** - Read-only analysis is safe\n- **Deletion Actions: Medium Risk** - Always verify before deleting resources\n- **Production Changes: High Risk** - Test rightsizing in dev\u002Fstaging first\n- Maintain backups before any deletion\n- Use `--dry-run` flag when available\n\n## Additional Resources\n\n- [AWS Cost Optimization Best Practices](https:\u002F\u002Faws.amazon.com\u002Fpricing\u002Fcost-optimization\u002F)\n- [AWS Well-Architected Framework - Cost Optimization](https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html)\n- [AWS Cost Explorer API](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcost-management\u002Flatest\u002FAPIReference\u002FWelcome.html)\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,148,883,"2026-05-16 13:04:48",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"57377cf2-326d-481b-afed-a86e02c742f9","1.0.0","aws-cost-optimizer.zip",2717,"uploads\u002Fskills\u002F4187ac09-a467-4647-b1c3-702420bf65f9\u002Faws-cost-optimizer.zip","bf9eddbb433c5beb7f18f456d2973664753db8867fcb62f29aa2d3a7e93a1743","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":6398}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]