بنقرة واحدة
cost-engineering
Expert reference for cloud cost optimization, FinOps practices, and infrastructure unit economics
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Expert reference for cloud cost optimization, FinOps practices, and infrastructure unit economics
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Expert reference for application security — OWASP Top 10 mitigations, auth/authz, secrets management, cryptography, input validation, dependency hygiene, and secure-by-default code patterns
Expert reference for token counting, prompt compression, cost estimation, and quality preservation when optimizing prompts for Claude models
Experimentation design and A/B testing standards for product teams
Expert reference for digital accessibility — WCAG conformance, ARIA, and inclusive design patterns
Authoritative reference for agent architecture selection, multi-agent orchestration, tool design, memory systems, and failure mode prevention
Expert reference for evaluating LLM systems, RAG pipelines, and AI features in production
| name | cost-engineering |
| description | Expert reference for cloud cost optimization, FinOps practices, and infrastructure unit economics |
| version | 1 |
If a workload runs >60% of the time at consistent utilization → purchase Reserved Instances or Committed Use Discounts. 1-year no-upfront saves ~40% vs on-demand; 3-year all-upfront saves ~60%. Never commit without usage data.
If a workload is fault-tolerant and interruptible (batch jobs, ML training, data processing) → use Spot Instances (AWS) or Preemptible VMs (GCP) or Spot VMs (Azure). Discount: 70-90% vs on-demand. Design for interruption: checkpointing, retry logic.
If S3 access pattern is unknown or mixed → enable S3 Intelligent-Tiering for objects >128KB. Automatically moves objects between frequent/infrequent/archive tiers. Monitoring fee: $0.0025/1000 objects — cost-effective above 128KB.
If data needs to be retained but rarely accessed for >90 days → move to Glacier or Archive tier. Glacier: ~$0.004/GB/month vs Standard $0.023/GB/month.
If Lambda functions are behind a NAT Gateway → evaluate moving to VPC endpoints for S3, DynamoDB, SQS. NAT Gateway costs $0.045/GB of data processed — VPC endpoints eliminate this for AWS services.
If cross-AZ traffic is significant → restructure to keep traffic within the same AZ where possible. Cross-AZ data transfer: $0.01/GB each way. Egress to internet: $0.09/GB first 10TB. These are often the #1 hidden cost.
If RDS or ElastiCache instances are running at <20% utilization → right-size down one instance class. AWS Compute Optimizer and GCP Recommender provide specific right-sizing recommendations.
If tagging compliance is below 95% → block with automated policy. Untagged resources cannot be attributed to teams, creating invisible cost centers.
Never delete or stop resources to reduce cost without checking for dependencies — use tagging and cost allocation first to understand what each resource serves.
Never report cost as absolute dollars alone — always show trend (MoM change), unit cost (per customer/call/GB), and budget variance (actual vs plan).
The FinOps Maturity Loop
INFORM → OPTIMIZE → OPERATE → back to INFORM
↓ ↓ ↓
Visibility Action Culture
Tag everything Right-size Engineers own cost
Allocate cost Reserve Forecasting
Anomaly detect Spot/Preempt Cost in CI/CD
Unit economics Waste cleanup Accountability
Cloud Cost Lever Priority (ROI-ranked)
1. Waste elimination → Unattached EBS, idle instances, orphaned snapshots (pure savings)
2. Right-sizing → Oversized instances (immediate, low risk)
3. Reserved/CUD → Steady workloads >60% utilization (40-60% discount)
4. Spot/Preemptible → Fault-tolerant batch/ML (70-90% discount)
5. Architecture change → NAT Gateway → VPC endpoints, cross-AZ reduction
6. Storage tiering → Intelligent-Tiering, Glacier transition
Work top-to-bottom. Waste first. Never commit reserved capacity on oversized instances.
Unit Cost Decomposition
Total Cloud Bill
├── Compute ($X) → cost per active user: $X / MAU
├── Storage ($X) → cost per GB stored: $X / TB
├── Data Transfer ($X) → cost per API call: $X / M calls
├── Database ($X) → cost per transaction: $X / M txn
└── AI/ML ($X) → cost per inference: $X / K tokens
| Term | Precise Meaning |
|---|---|
| FinOps | Financial Operations — practice of bringing financial accountability to cloud spend |
| Unit economics | Cost measured per unit of business value (per user, per call, per transaction) |
| Reserved Instance (RI) | Commitment to use specific compute for 1 or 3 years in exchange for 40-60% discount |
| Committed Use Discount (CUD) | GCP equivalent of Reserved Instances — commit to spend or resource level |
| Savings Plans | AWS flexible discount commitment — covers any EC2/Fargate/Lambda usage, not specific instance type |
| Spot Instance | Spare cloud capacity at 70-90% discount — can be interrupted with 2-min notice |
| Right-sizing | Matching instance type and size to actual workload requirements |
| Showback | Reporting cost attribution to teams without charging back — awareness without consequence |
| Chargeback | Billing business units for their cloud consumption — requires mature tagging and buy-in |
| Egress cost | Data transfer out of cloud to internet — often $0.09/GB, frequently the #1 surprise cost |
| Intelligent-Tiering | AWS S3 feature that auto-moves objects between access tiers based on usage patterns |
| CUDOS | AWS Cost and Usage Dashboard — the reference architecture for cost visibility in AWS |
Mistake 1: Buying Reserved Instances on estimated usage
Mistake 2: Ignoring data transfer costs
Mistake 3: Tagging as documentation not enforcement
ec2:RunInstances, rds:CreateDBInstance, etc. without Team and Environment tags. Non-compliant resources cannot be created.Mistake 4: Cost visibility only for leadership
Mistake 5: Right-sizing without load testing
BAD cost report:
"Cloud spend this month: $142,000. Up from $128,000 last month."
GOOD cost report:
Cloud Cost Summary — April 2025
Total: $142,000 (+$14K MoM, +11%)
Budget: $135,000 — OVER by $7K ⚠
Unit Economics:
Cost per active user: $0.83 (prev: $0.79, +5%) ⚠
Cost per API call: $0.0021 (prev: $0.0019, +10%) ⚠
Gross margin impact: 68.2% (prev: 69.1%, -0.9pp)
Top Cost Drivers (vs last month):
+$9K — Data transfer (investigate: new EMEA PoP cross-AZ traffic)
+$3K — RDS (new analytics replica added, review necessity)
+$4K — EC2 (legitimate growth, in line with user growth)
-$2K — S3 (Intelligent-Tiering saving as expected)
Optimization Opportunities:
1. 3× m5.2xlarge at <15% utilization → downsize saves ~$800/mo
2. NAT Gateway: $4,200 → VPC endpoints for S3/DynamoDB saves ~$2,500/mo
3. 8× unattached EBS volumes → delete saves $340/mo