opensite-ai/opensite-skills / aws-billing-and-cost-management
aws-billing-and-cost-management
VerifiedAnalyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.
| File | Kind | Size |
|---|---|---|
| .aws-skill-metadata | other | 18 B |
| SKILL.md | skill md | 8.9 KB |
| references/budgets.md | markdown | 2.4 KB |
| references/cost-audit.md | markdown | 3.2 KB |
| references/cost-explorer.md | markdown | 7.3 KB |
| references/cost-optimization-hub.md | markdown | 7.2 KB |
| references/cur-athena.md | markdown | 7.0 KB |
| references/deterministic-calculations.md | markdown | 2.5 KB |
| references/ebs-optimization.md | markdown | 2.7 KB |
| references/ec2-rightsizing.md | markdown | 3.3 KB |
| references/free-tier.md | markdown | 1.6 KB |
| references/lambda-optimization.md | markdown | 2.2 KB |
| references/pricing-lookup.md | markdown | 3.8 KB |
| references/rds-optimization.md | markdown | 1.8 KB |
| references/reserved-instances.md | markdown | 2.3 KB |
| references/savings-plans.md | markdown | 3.3 KB |
| references/service-optimization.md | markdown | 3.0 KB |
references/lambda-optimization.md
View on GitHub# Lambda Optimization
> **Pricing note:** All prices shown are us-east-1 approximate as of early 2026. Prices vary by region and may change. Always verify current pricing via the Price List API before reporting to users.
## Memory-CPU Relationship
Lambda allocates CPU proportional to memory:
- 1,769 MB = 1 full vCPU
- 10,240 MB = 6 vCPUs
Over-provisioning memory gives more CPU, which can reduce duration enough to lower total cost. Cost = Invocations × Duration(ms) × Memory(GB) × Price/GB-ms + Request charges.
## Compute Optimizer for Lambda
**Requirements:** ≤1,792 MB memory AND ≥50 invocations in the lookback period.
Metrics analyzed: Invocations, Duration, Errors, Throttles, Memory Utilization. The engine simulates candidate memory sizes, projects duration, and selects the size that finishes within timeout and produces greatest monthly savings.
Findings: `NotOptimized` (can be improved), `Optimized`, `Unavailable` (insufficient data). Note: Lambda and EC2 use different finding value sets. Lambda: `NotOptimized`/`Optimized`/`Unavailable`. EC2: `Overprovisioned`/`Underprovisioned`/`Optimized`/`NotOptimized`.
```bash
aws compute-optimizer get-lambda-function-recommendations \
--filters Name=Finding,Values=NotOptimized
```
## Optimization Levers
| Strategy | Savings | Effort |
|----------|---------|--------|
| Switch to arm64 (Graviton) | ~20% cost + ~10-15% faster | Low — config change |
| Right-size memory with Power Tuning | 10-50% | Medium |
| Use SnapStart (Java/Python/.NET) | Eliminates provisioned concurrency cost | Low |
```bash
# Switch to arm64
aws lambda update-function-configuration \
--function-name my-function --architectures arm64
```
## Gotchas
- arm64 not available in all regions; native compiled dependencies need arm64 builds
- Reserved concurrency (free) ≠ Provisioned concurrency (paid) — most common Lambda cost confusion
- Provisioned concurrency costs ~$0.015/GB-hour even when idle — use SnapStart instead where possible
- Lambda needs 14 days of CloudWatch metrics before Compute Optimizer generates recommendations
- Use `alexcasalboni/aws-lambda-power-tuning` Step Functions state machine for systematic memory optimization
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |