Cloud Cost Optimization
Unverified●30/40Claude Code◐PartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
Cursor◐PartialPlain prose you can paste in — but no Cursor rules file
Codex◐PartialPlain prose you can paste in — but no AGENTS.md
Gemini CLI◐PartialPlain prose you can paste in
Copilot◐PartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add cost-optimizationWho is stuck, and on what
Optimize cloud costs across AWS, Azure, GCP, and OCI through resource rightsizing, tagging strategies, reserved instances, and spending analysis. Use when reducing cloud expenses, analyzing infrastructure costs, or implementing cost governance policies.
The whole source
Frontmatter — 2 properties
| name | cost-optimization |
|---|---|
| description | Optimize cloud costs across AWS, Azure, GCP, and OCI through resource rightsizing, tagging strategies, reserved instances, and spending analysis. Use when reducing cloud expenses, analyzing infrastructure costs, or implementing cost governance policies. |
| 1 | --- |
| 2 | name: cost-optimization |
| 3 | description: Optimize cloud costs across AWS, Azure, GCP, and OCI through resource rightsizing, tagging strategies, reserved instances, and spending analysis. Use when reducing cloud expenses, analyzing infrastructure costs, or implementing cost governance policies. |
| 4 | ---A5 — No allowed-tools declared — no way to tell what this skill may touch |
| 5 | |
| 6 | # Cloud Cost Optimization |
| 7 | |
| 8 | Strategies and patterns for optimizing cloud costs across AWS, Azure, GCP, and OCI. |
| 9 | |
| 10 | ## Purpose |
| 11 | |
| 12 | Implement systematic cost optimization strategies to reduce cloud spending while maintaining performance and reliability. |
| 13 | |
| 14 | ## When to Use |
| 15 | |
| 16 | - Reduce cloud spending |
| 17 | - Right-size resources |
| 18 | - Implement cost governance |
| 19 | - Optimize multi-cloud costs |
| 20 | - Meet budget constraints |
| 21 | |
| 22 | ## Cost Optimization Framework |
| 23 | |
| 24 | ### 1. Visibility |
| 25 | |
| 26 | - Implement cost allocation tags |
| 27 | - Use cloud cost management tools |
| 28 | - Set up budget alerts |
| 29 | - Create cost dashboards |
| 30 | |
| 31 | ### 2. Right-Sizing |
| 32 | |
| 33 | - Analyze resource utilization |
| 34 | - Downsize over-provisioned resources |
| 35 | - Use auto-scaling |
| 36 | - Remove idle resources |
| 37 | |
| 38 | ### 3. Pricing Models |
| 39 | |
| 40 | - Use reserved capacity |
| 41 | - Leverage spot/preemptible instances |
| 42 | - Implement savings plans |
| 43 | - Use committed use discounts |
| 44 | |
| 45 | ### 4. Architecture Optimization |
| 46 | |
| 47 | - Use managed services |
| 48 | - Implement caching |
| 49 | - Optimize data transfer |
| 50 | - Use lifecycle policies |
| 51 | |
| 52 | ## AWS Cost Optimization |
| 53 | |
| 54 | ### Reserved Instances |
| 55 | |
| 56 | ``` |
| 57 | Savings: 30-72% vs On-Demand |
| 58 | Term: 1 or 3 years |
| 59 | Payment: All/Partial/No upfront |
| 60 | Flexibility: Standard or Convertible |
| 61 | ``` |
| 62 | |
| 63 | ### Savings Plans |
| 64 | |
| 65 | ``` |
| 66 | Compute Savings Plans: 66% savings |
| 67 | EC2 Instance Savings Plans: 72% savings |
| 68 | Applies to: EC2, Fargate, Lambda |
| 69 | Flexible across: Instance families, regions, OS |
| 70 | ``` |
| 71 | |
| 72 | ### Spot Instances |
| 73 | |
| 74 | ``` |
| 75 | Savings: Up to 90% vs On-Demand |
| 76 | Best for: Batch jobs, CI/CD, stateless workloads |
| 77 | Risk: 2-minute interruption notice |
| 78 | Strategy: Mix with On-Demand for resilience |
| 79 | ``` |
| 80 | |
| 81 | ### S3 Cost Optimization |
| 82 | |
| 83 | ```hcl |
| 84 | resource "aws_s3_bucket_lifecycle_configuration" "example" { |
| 85 | bucket = aws_s3_bucket.example.id |
| 86 | |
| 87 | rule { |
| 88 | id = "transition-to-ia" |
| 89 | status = "Enabled" |
| 90 | |
| 91 | transition { |
| 92 | days = 30 |
| 93 | storage_class = "STANDARD_IA" |
| 94 | } |
| 95 | |
| 96 | transition { |
| 97 | days = 90 |
| 98 | storage_class = "GLACIER" |
| 99 | } |
| 100 | |
| 101 | expiration { |
| 102 | days = 365 |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | ``` |
| 107 | |
| 108 | ## Azure Cost Optimization |
| 109 | |
| 110 | ### Reserved VM Instances |
| 111 | |
| 112 | - 1 or 3 year terms |
| 113 | - Up to 72% savings |
| 114 | - Flexible sizing |
| 115 | - Exchangeable |
| 116 | |
| 117 | ### Azure Hybrid Benefit |
| 118 | |
| 119 | - Use existing Windows Server licenses |
| 120 | - Up to 80% savings with RI |
| 121 | - Available for Windows and SQL Server |
| 122 | |
| 123 | ### Azure Advisor Recommendations |
| 124 | |
| 125 | - Right-size VMs |
| 126 | - Delete unused resources |
| 127 | - Use reserved capacity |
| 128 | - Optimize storage |
| 129 | |
| 130 | ## GCP Cost Optimization |
| 131 | |
| 132 | ### Committed Use Discounts |
| 133 | |
| 134 | - 1 or 3 year commitment |
| 135 | - Up to 57% savings |
| 136 | - Applies to vCPUs and memory |
| 137 | - Resource-based or spend-based |
| 138 | |
| 139 | ### Sustained Use Discounts |
| 140 | |
| 141 | - Automatic discounts |
| 142 | - Up to 30% for running instances |
| 143 | - No commitment required |
| 144 | - Applies to Compute Engine, GKE |
| 145 | |
| 146 | ### Preemptible VMs |
| 147 | |
| 148 | - Up to 80% savings |
| 149 | - 24-hour maximum runtime |
| 150 | - Best for batch workloads |
| 151 | |
| 152 | ## OCI Cost Optimization |
| 153 | |
| 154 | ### Flexible Shapes |
| 155 | |
| 156 | - Scale OCPUs and memory independently |
| 157 | - Match instance sizing to workload demand |
| 158 | - Reduce wasted capacity from fixed VM shapes |
| 159 | |
| 160 | ### Commitments and Budgets |
| 161 | |
| 162 | - Use annual commitments for predictable spend |
| 163 | - Set compartment-level budgets with alerts |
| 164 | - Track monthly forecasts with OCI Cost Analysis |
| 165 | |
| 166 | ### Preemptible Capacity |
| 167 | |
| 168 | - Use preemptible instances for batch and ephemeral workloads |
| 169 | - Keep interruption-tolerant autoscaling groups |
| 170 | - Mix with standard capacity for critical services |
| 171 | |
| 172 | ## Tagging Strategy |
| 173 | |
| 174 | ### AWS Tagging |
| 175 | |
| 176 | ```hcl |
| 177 | locals { |
| 178 | common_tags = { |
| 179 | Environment = "production" |
| 180 | Project = "my-project" |
| 181 | CostCenter = "engineering" |
| 182 | Owner = "[email protected]" |
| 183 | ManagedBy = "terraform" |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | resource "aws_instance" "example" { |
| 188 | ami = "ami-12345678" |
| 189 | instance_type = "t3.medium" |
| 190 | |
| 191 | tags = merge( |
| 192 | local.common_tags, |
| 193 | { |
| 194 | Name = "web-server" |
| 195 | } |
| 196 | ) |
| 197 | } |
| 198 | ``` |
| 199 | |
| 200 | **Reference:** See `references/tagging-standards.md` |
| 201 | |
| 202 | ## Cost Monitoring |
| 203 | |
| 204 | ### Budget Alerts |
| 205 | |
| 206 | ```hcl |
| 207 | # AWS Budget |
| 208 | resource "aws_budgets_budget" "monthly" { |
| 209 | name = "monthly-budget" |
| 210 | budget_type = "COST" |
| 211 | limit_amount = "1000" |
| 212 | limit_unit = "USD" |
| 213 | time_period_start = "2024-01-01_00:00" |
| 214 | time_unit = "MONTHLY" |
| 215 | |
| 216 | notification { |
| 217 | comparison_operator = "GREATER_THAN" |
| 218 | threshold = 80 |
| 219 | threshold_type = "PERCENTAGE" |
| 220 | notification_type = "ACTUAL" |
| 221 | subscriber_email_addresses = ["[email protected]"] |
| 222 | } |
| 223 | } |
| 224 | ``` |
| 225 | |
| 226 | ### Cost Anomaly Detection |
| 227 | |
| 228 | - AWS Cost Anomaly Detection |
| 229 | - Azure Cost Management alerts |
| 230 | - GCP Budget alerts |
| 231 | - OCI Budgets and Cost Analysis |
| 232 | |
| 233 | ## Architecture Patterns |
| 234 | |
| 235 | ### Pattern 1: Serverless First |
| 236 | |
| 237 | - Use Lambda/Functions for event-driven |
| 238 | - Pay only for execution time |
| 239 | - Auto-scaling included |
| 240 | - No idle costs |
| 241 | |
| 242 | ### Pattern 2: Right-Sized Databases |
| 243 | |
| 244 | ``` |
| 245 | Development: t3.small RDS |
| 246 | Staging: t3.large RDS |
| 247 | Production: r6g.2xlarge RDS with read replicas |
| 248 | ``` |
| 249 | |
| 250 | ### Pattern 3: Multi-Tier Storage |
| 251 | |
| 252 | ``` |
| 253 | Hot data: S3 Standard |
| 254 | Warm data: S3 Standard-IA (30 days) |
| 255 | Cold data: S3 Glacier (90 days) |
| 256 | Archive: S3 Deep Archive (365 days) |
| 257 | ``` |
| 258 | |
| 259 | ### Pattern 4: Auto-Scaling |
| 260 | |
| 261 | ```hcl |
| 262 | resource "aws_autoscaling_policy" "scale_up" { |
| 263 | name = "scale-up" |
| 264 | scaling_adjustment = 2 |
| 265 | adjustment_type = "ChangeInCapacity" |
| 266 | cooldown = 300 |
| 267 | autoscaling_group_name = aws_autoscaling_group.main.name |
| 268 | } |
| 269 | |
| 270 | resource "aws_cloudwatch_metric_alarm" "cpu_high" { |
| 271 | alarm_name = "cpu-high" |
| 272 | comparison_operator = "GreaterThanThreshold" |
| 273 | evaluation_periods = "2" |
| 274 | metric_name = "CPUUtilization" |
| 275 | namespace = "AWS/EC2" |
| 276 | period = "60" |
| 277 | statistic = "Average" |
| 278 | threshold = "80" |
| 279 | alarm_actions = [aws_autoscaling_policy.scale_up.arn] |
| 280 | } |
| 281 | ``` |
| 282 | |
| 283 | ## Cost Optimization Checklist |
| 284 | |
| 285 | - [ ] Implement cost allocation tags |
| 286 | - [ ] Delete unused resources (EBS, EIPs, snapshots) |
| 287 | - [ ] Right-size instances based on utilization |
| 288 | - [ ] Use reserved capacity for steady workloads |
| 289 | - [ ] Implement auto-scaling |
| 290 | - [ ] Optimize storage classes |
| 291 | - [ ] Use lifecycle policies |
| 292 | - [ ] Enable cost anomaly detection |
| 293 | - [ ] Set budget alerts |
| 294 | - [ ] Review costs weekly |
| 295 | - [ ] Use spot/preemptible instances |
| 296 | - [ ] Optimize data transfer costs |
| 297 | - [ ] Implement caching layers |
| 298 | - [ ] Use managed services |
| 299 | - [ ] Monitor and optimize continuously |
| 300 | |
| 301 | ## Tools |
| 302 | |
| 303 | - **AWS:** Cost Explorer, Cost Anomaly Detection, Compute Optimizer |
| 304 | - **Azure:** Cost Management, Advisor |
| 305 | - **GCP:** Cost Management, Recommender |
| 306 | - **OCI:** Cost Analysis, Budgets, Cloud Advisor |
| 307 | - **Multi-cloud:** CloudHealth, Cloudability, Kubecost |
| 308 | |
| 309 | |
| 310 | ## Related Skills |
| 311 | |
| 312 | - `terraform-module-library` - For resource provisioning |
| 313 | - `multi-cloud-architecture` - For cloud selection |
| 314 |
Reviews
Installed this one?Write the first review and take the Trailblazer badge.
Alternatives
Paper Poster (HTML): measurement-gated poster generationDEFAULT poster pipeline — build an academic conference poster (ICML/NeurIPS/ICLR/CVPR/...) as a single HTML/CSS file with measurement-driven hard gates, real paper figures, a two-hue design-token system, and print-ready PDF via headless Chromium. Use when the●····●36/40Brand Monitoring 📡Brand monitoring tool for tracking mentions across social media platforms. Monitor Reddit, Google News, YouTube, and DuckDuckGo for brand mentions. Includes sentiment analysis, trend tracking, crisis detection, and competitor comparison. No API key required fo◐····●34/40Spark Memory & Thermal OpsManage unified memory and thermals during long-running ML jobs on NVIDIA DGX Spark. Use when planning memory headroom for a training run on GB10, when a job OOMs on unified memory, or when monitoring temperature and power during multi-hour training.◐····●32/40Secrets ManagementImplement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD environments.◐····●32/40