Skip to main content

Claude Prompt for AWS Cost Optimization

Turn your AWS bill and usage data into a week-to-quarter FinOps action plan with right-sizing, RI, Spot, and governance recommendations.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt converts a structured snapshot of your AWS architecture, service costs, and usage patterns into a three-horizon cost reduction plan with a governance layer running across all of them. By requiring actual monthly spend figures, per-service costs, and growth trajectory upfront, the template forces the AI to produce recommendations grounded in your numbers rather than recycled AWS best-practice lists.

The structure mirrors how real FinOps work gets sequenced. Quick Wins are safe to action this week with low blast radius. Medium-Term changes require some coordination but pay back within the billing cycle. Architectural Changes are the highest-leverage recommendations and need a planning cycle to execute safely. The Monitoring and Governance section is not a fourth time horizon—it underpins all three, giving you the Cost Explorer queries, budget alerts, and tag strategy to track whether the other changes actually landed.

Every recommendation the prompt requests includes a cost-delta format: current cost → projected cost → monthly savings → implementation effort. That explicit structure keeps the output honest and eliminates the vague "this could save you money" language that makes most AI-assisted cost reviews useless.

When to use it

  • Your AWS bill has grown 30%+ month-over-month and you need to explain and address it before the next leadership review.
  • You are preparing a FinOps review and want a first-pass audit before engaging an AWS Solutions Architect or TAM.
  • You are migrating a workload to AWS and want to pressure-test architecture choices—particularly whether Aurora is justified over RDS, or whether NAT Gateways should be replaced with VPC endpoints—before committing to long-term pricing.
  • You need to evaluate whether to convert On-Demand spend to a 1-year or 3-year Savings Plan and need a commitment analysis with a concrete payback period.
  • Your team is spinning up Spot Instances ad hoc and you want a coherent Spot strategy scoped to the right workload candidates.
  • You need a cost-allocation tag strategy and budget alert structure before your org scales to multiple teams or AWS accounts.

Example output

Quick Wins (this week)

RDS db.r5.2xlarge (MySQL) — CPU avg 12%, 8 GB RAM used of 64 GB
  Current: $420/mo | Projected: $105/mo | Saves: $315/mo | Effort: 2h
  Action: snapshot, resize to db.r5.large, run regression tests against staging

3x EC2 i3.xlarge in dev account — idle 30+ days, zero inbound traffic
  Current: $650/mo | Projected: $0 | Saves: $650/mo | Effort: 30 min
  WARNING: i3 instances use local NVMe SSD — data on instance storage is lost on
  termination. Confirm no persistent data before acting.
  Action: snapshot any EBS volumes, document local storage contents, terminate;
  replace with Spot or on-demand t3/m5 instances when dev next needs compute

S3 bucket 'media-archive' (4.2 TB, last accessed >90 days)
  Current: $96/mo | Projected: $19/mo | Saves: $77/mo | Effort: 1h
  Action: add S3 lifecycle rule to transition to Glacier Instant Retrieval at 90 days

Pro tips

  • Pull your [monthly_spend] and [service_costs] from Cost Explorer, not the billing dashboard. The billing dashboard shows estimated charges and can lag. In Cost Explorer, filter by the last complete calendar month, group by Service, and export to CSV. This takes two minutes and gives the AI numbers it can actually reason about.
  • [architecture] needs instance types and regions, not tier labels. "3x EC2 t3.medium behind ALB in us-east-1, RDS Multi-AZ db.r5.2xlarge in us-west-2" gives the AI something to right-size. "Web tier plus database" gives it nothing.
  • [spot_candidates] is the highest-leverage variable in the template. Rank workloads by interruption tolerance explicitly: batch jobs, CI runners, and stateless auto-scaled workers are ideal; stateful services, real-time APIs, and anything holding local disk state are not. The more specific you are here, the more realistic the Spot interruption strategy.
  • Set [savings_target] as a percentage of current spend, not an absolute number. "Reduce by $4,000/mo" anchors the AI to a single path. "Reduce by 25-35%" lets it surface the full optimization surface across all four sections and rank recommendations by ROI.
  • For Reserved Instance analysis, include how long each instance type has been running On-Demand. An instance running continuously for 8+ months is a strong 1-year RI candidate; the AI can calculate the breakeven point precisely if you give it the runtime duration.
  • Run this prompt quarterly and update [growth] each time. Savings Plan coverage that made sense at $15k/mo may be wrong at $40k/mo. New AWS services, region expansions, and pricing changes open optimization windows that did not exist on the previous run.
  • Cross-validate instance right-sizing suggestions against Cost Explorer's Right Sizing Recommendations report before acting. The AI output is directionally correct and faster to generate; Cost Explorer gives you actual utilization percentiles from your account's CloudWatch data to confirm before you resize production.

Frequently Asked Questions

Does this prompt work if I don't know my exact per-service costs?
It works better with specific numbers, but rough estimates are a valid starting point. Open Cost Explorer, filter by the last complete calendar month, and group by Service—it takes two minutes. If you use estimates, note that explicitly in [service_costs]; the AI will flag which recommendations are most sensitive to accurate cost data and which are safe to act on regardless of precision.
The template mentions replacing Aurora with RDS and NAT Gateways with VPC endpoints as architectural substitutions—when does that actually make sense?
Aurora costs roughly 20-30% more than equivalent RDS MySQL/PostgreSQL for the same compute. If you are not using Aurora-specific features—Global Database, Serverless v2 autoscaling, or Aurora-native parallel query—standard RDS Multi-AZ is functionally identical at lower cost. NAT Gateway charges $0.045 per GB of data processed in addition to the hourly fee; if your workloads are calling AWS services like S3, DynamoDB, or SQS from private subnets, VPC endpoints eliminate that per-GB charge entirely. Include your current Aurora feature usage and NAT Gateway data transfer costs in [service_costs] and [architecture] and the prompt will assess both substitutions for your specific setup.
Can I use this for a multi-account AWS Organizations setup?
Yes, but run it per-account or per-business-unit first, then do a second pass with aggregated spend and a note about your Organizations structure in [architecture]. The Monitoring and Governance section is especially relevant for multi-account setups: include your current tagging posture and whether you have a management account with consolidated billing enabled. The prompt's tag strategy and budget alert recommendations will scope to your org structure if you describe it.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in DevOps & Cloud Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support