[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-c6c1bb23-4dd3-4b55-b3b7-3acbadf7bdee":3,"$fkj2HPJ97Gwb1Wt_e_JX_CEklzY1YSaAAEbATBNdRPME":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},"c6c1bb23-4dd3-4b55-b3b7-3acbadf7bdee","cost-optimization","AWS、Azure和GCP跨云优化策略和模式。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: cost-optimization\ndescription: \"Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.\"\nrisk: unknown\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# Cloud Cost Optimization\n\nStrategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.\n\n## Do not use this skill when\n\n- The task is unrelated to cloud cost optimization\n- You need a different domain or tool outside this scope\n\n## Instructions\n\n- Clarify goals, constraints, and required inputs.\n- Apply relevant best practices and validate outcomes.\n- Provide actionable steps and verification.\n- If detailed examples are required, open `resources\u002Fimplementation-playbook.md`.\n\n## Purpose\n\nImplement systematic cost optimization strategies to reduce cloud spending while maintaining performance and reliability.\n\n## Use this skill when\n\n- Reduce cloud spending\n- Right-size resources\n- Implement cost governance\n- Optimize multi-cloud costs\n- Meet budget constraints\n\n## Cost Optimization Framework\n\n### 1. Visibility\n- Implement cost allocation tags\n- Use cloud cost management tools\n- Set up budget alerts\n- Create cost dashboards\n\n### 2. Right-Sizing\n- Analyze resource utilization\n- Downsize over-provisioned resources\n- Use auto-scaling\n- Remove idle resources\n\n### 3. Pricing Models\n- Use reserved capacity\n- Leverage spot\u002Fpreemptible instances\n- Implement savings plans\n- Use committed use discounts\n\n### 4. Architecture Optimization\n- Use managed services\n- Implement caching\n- Optimize data transfer\n- Use lifecycle policies\n\n## AWS Cost Optimization\n\n### Reserved Instances\n```\nSavings: 30-72% vs On-Demand\nTerm: 1 or 3 years\nPayment: All\u002FPartial\u002FNo upfront\nFlexibility: Standard or Convertible\n```\n\n### Savings Plans\n```\nCompute Savings Plans: 66% savings\nEC2 Instance Savings Plans: 72% savings\nApplies to: EC2, Fargate, Lambda\nFlexible across: Instance families, regions, OS\n```\n\n### Spot Instances\n```\nSavings: Up to 90% vs On-Demand\nBest for: Batch jobs, CI\u002FCD, stateless workloads\nRisk: 2-minute interruption notice\nStrategy: Mix with On-Demand for resilience\n```\n\n### S3 Cost Optimization\n```hcl\nresource \"aws_s3_bucket_lifecycle_configuration\" \"example\" {\n  bucket = aws_s3_bucket.example.id\n\n  rule {\n    id     = \"transition-to-ia\"\n    status = \"Enabled\"\n\n    transition {\n      days          = 30\n      storage_class = \"STANDARD_IA\"\n    }\n\n    transition {\n      days          = 90\n      storage_class = \"GLACIER\"\n    }\n\n    expiration {\n      days = 365\n    }\n  }\n}\n```\n\n## Azure Cost Optimization\n\n### Reserved VM Instances\n- 1 or 3 year terms\n- Up to 72% savings\n- Flexible sizing\n- Exchangeable\n\n### Azure Hybrid Benefit\n- Use existing Windows Server licenses\n- Up to 80% savings with RI\n- Available for Windows and SQL Server\n\n### Azure Advisor Recommendations\n- Right-size VMs\n- Delete unused resources\n- Use reserved capacity\n- Optimize storage\n\n## GCP Cost Optimization\n\n### Committed Use Discounts\n- 1 or 3 year commitment\n- Up to 57% savings\n- Applies to vCPUs and memory\n- Resource-based or spend-based\n\n### Sustained Use Discounts\n- Automatic discounts\n- Up to 30% for running instances\n- No commitment required\n- Applies to Compute Engine, GKE\n\n### Preemptible VMs\n- Up to 80% savings\n- 24-hour maximum runtime\n- Best for batch workloads\n\n## Tagging Strategy\n\n### AWS Tagging\n```hcl\nlocals {\n  common_tags = {\n    Environment = \"production\"\n    Project     = \"my-project\"\n    CostCenter  = \"engineering\"\n    Owner       = \"team@example.com\"\n    ManagedBy   = \"terraform\"\n  }\n}\n\nresource \"aws_instance\" \"example\" {\n  ami           = \"ami-12345678\"\n  instance_type = \"t3.medium\"\n\n  tags = merge(\n    local.common_tags,\n    {\n      Name = \"web-server\"\n    }\n  )\n}\n```\n\n**Reference:** See `references\u002Ftagging-standards.md`\n\n## Cost Monitoring\n\n### Budget Alerts\n```hcl\n# AWS Budget\nresource \"aws_budgets_budget\" \"monthly\" {\n  name              = \"monthly-budget\"\n  budget_type       = \"COST\"\n  limit_amount      = \"1000\"\n  limit_unit        = \"USD\"\n  time_period_start = \"2024-01-01_00:00\"\n  time_unit         = \"MONTHLY\"\n\n  notification {\n    comparison_operator        = \"GREATER_THAN\"\n    threshold                  = 80\n    threshold_type            = \"PERCENTAGE\"\n    notification_type         = \"ACTUAL\"\n    subscriber_email_addresses = [\"team@example.com\"]\n  }\n}\n```\n\n### Cost Anomaly Detection\n- AWS Cost Anomaly Detection\n- Azure Cost Management alerts\n- GCP Budget alerts\n\n## Architecture Patterns\n\n### Pattern 1: Serverless First\n- Use Lambda\u002FFunctions for event-driven\n- Pay only for execution time\n- Auto-scaling included\n- No idle costs\n\n### Pattern 2: Right-Sized Databases\n```\nDevelopment: t3.small RDS\nStaging: t3.large RDS\nProduction: r6g.2xlarge RDS with read replicas\n```\n\n### Pattern 3: Multi-Tier Storage\n```\nHot data: S3 Standard\nWarm data: S3 Standard-IA (30 days)\nCold data: S3 Glacier (90 days)\nArchive: S3 Deep Archive (365 days)\n```\n\n### Pattern 4: Auto-Scaling\n```hcl\nresource \"aws_autoscaling_policy\" \"scale_up\" {\n  name                   = \"scale-up\"\n  scaling_adjustment     = 2\n  adjustment_type        = \"ChangeInCapacity\"\n  cooldown              = 300\n  autoscaling_group_name = aws_autoscaling_group.main.name\n}\n\nresource \"aws_cloudwatch_metric_alarm\" \"cpu_high\" {\n  alarm_name          = \"cpu-high\"\n  comparison_operator = \"GreaterThanThreshold\"\n  evaluation_periods  = \"2\"\n  metric_name         = \"CPUUtilization\"\n  namespace           = \"AWS\u002FEC2\"\n  period              = \"60\"\n  statistic           = \"Average\"\n  threshold           = \"80\"\n  alarm_actions       = [aws_autoscaling_policy.scale_up.arn]\n}\n```\n\n## Cost Optimization Checklist\n\n- [ ] Implement cost allocation tags\n- [ ] Delete unused resources (EBS, EIPs, snapshots)\n- [ ] Right-size instances based on utilization\n- [ ] Use reserved capacity for steady workloads\n- [ ] Implement auto-scaling\n- [ ] Optimize storage classes\n- [ ] Use lifecycle policies\n- [ ] Enable cost anomaly detection\n- [ ] Set budget alerts\n- [ ] Review costs weekly\n- [ ] Use spot\u002Fpreemptible instances\n- [ ] Optimize data transfer costs\n- [ ] Implement caching layers\n- [ ] Use managed services\n- [ ] Monitor and optimize continuously\n\n## Tools\n\n- **AWS:** Cost Explorer, Cost Anomaly Detection, Compute Optimizer\n- **Azure:** Cost Management, Advisor\n- **GCP:** Cost Management, Recommender\n- **Multi-cloud:** CloudHealth, Cloudability, Kubecost\n\n## Reference Files\n\n- `references\u002Ftagging-standards.md` - Tagging conventions\n- `assets\u002Fcost-analysis-template.xlsx` - Cost analysis spreadsheet\n\n## Related Skills\n\n- `terraform-module-library` - For resource provisioning\n- `multi-cloud-architecture` - For cloud selection\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,179,223,"2026-05-16 13:13:28",{"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},"9b1ad68d-2c90-4957-8541-fc9ab00a867c","1.0.0","cost-optimization.zip",3028,"uploads\u002Fskills\u002Fc6c1bb23-4dd3-4b55-b3b7-3acbadf7bdee\u002Fcost-optimization.zip","9a2b7ffb2a40ce5fb1e7424490cb5e6dc5c2b23ccd6b5662d694dc446c323de5","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":6950}]",{"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]