Skip to main content

Claude/ChatGPT Prompt to Design a Serverless AWS Lambda Architecture

Design a complete serverless AWS architecture - Lambda, API Gateway, DynamoDB, and event-driven patterns with cost estimation.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Design a serverless architecture on AWS for real-time order processing platform that handles 1000 req/s baseline with 5x spikes during peak hours. 1) API layer: configure API Gateway (HTTP API (cheaper) for REST, WebSocket API for real-time) with Lambda integration for 20 endpoints — include request validation, CORS, and API keys. 2) Compute: design Lambda functions with Node.js 20 runtime — determine optimal memory allocation, timeout settings, and cold start mitigation strategies for p99 under 200ms for synchronous endpoints. 3) Data layer: choose between DynamoDB and Aurora Serverless for high-throughput key-value lookups with occasional range queries — design the table schema with proper partition keys, sort keys, and GSIs for lookup order by id, list orders by customer, query orders by status and date range. 4) Event processing: set up SQS queues, S3 uploads, DynamoDB Streams, and EventBridge schedules triggering Lambda functions with proper error handling, dead letter queues, and retry policies. 5) Authentication: configure Cognito or Amazon Cognito User Pools with JWT authorizers with API Gateway authorizers. 6) Observability: set up X-Ray tracing, CloudWatch dashboards, and custom metrics for business KPIs. 7) Cost estimation: calculate monthly cost for 50 million requests, 500GB data transfer using the AWS pricing model. 8) Cold start optimization: implement provisioned concurrency or SnapStart for latency-sensitive endpoints.

What this prompt does

This prompt drives the AI to design a complete serverless AWS architecture for [application_type] handling [traffic_pattern]. It configures an API Gateway ([api_type]) front for [endpoint_count] endpoints, designs [runtime] Lambda functions with memory, timeout, and cold-start mitigation for [latency_requirement], chooses between DynamoDB and Aurora Serverless for [data_pattern] and models [access_patterns], wires [event_sources] with DLQs and retries, sets up [auth_method], adds X-Ray and CloudWatch observability, estimates monthly cost for [expected_load], and applies provisioned concurrency or SnapStart.

The structure works because it forces the model to reason about cold starts, capacity, and a real monthly cost estimate before any IaC is written. Naming [access_patterns] up front is what produces a sound DynamoDB key design instead of a relational schema bolted onto a key-value store. Pricing [expected_load] early surfaces cost surprises while they are still cheap to fix.

When to use it

  • You are scoping a new serverless backend and want a defensible design before writing CDK or Terraform.
  • Your traffic has spikes ([traffic_pattern]) and you need cold-start and concurrency strategy decided up front.
  • You need a DynamoDB schema designed around real [access_patterns] rather than guessed at later.
  • You want a monthly cost estimate for [expected_load] before committing to the architecture.
  • You are integrating event sources like SQS, S3, or DynamoDB Streams and need error handling and DLQs designed in.
  • You have a latency target like [latency_requirement] and need provisioned concurrency or SnapStart planned for it.

Example output

Expect an architecture document: an API Gateway configuration for [api_type], Lambda function specs with memory/timeout/cold-start notes, a data-layer recommendation (DynamoDB vs Aurora Serverless) with a table schema including partition keys, sort keys, and GSIs mapped to [access_patterns], an event-processing design with DLQs and retries, an auth setup, an observability plan, and a monthly cost breakdown for [expected_load]. You then translate it into IaC.

Pro tips

  • Spell out every [access_patterns] entry; DynamoDB single-table design is only as good as the access patterns you give it, and missing one means a painful re-model later.
  • Be realistic about [traffic_pattern] spikes — the cold-start and provisioned-concurrency strategy depends entirely on how bursty the load actually is.
  • Treat the [expected_load] cost estimate as a planning input, not a quote; verify it against the AWS pricing calculator before quoting anyone.
  • Reserve provisioned concurrency for the endpoints that truly need [latency_requirement]; applying it everywhere quietly inflates the bill.
  • Design DLQs and retry policies for every [event_sources] integration up front; retrofitting error handling after events start dropping is the harder path.
  • Translate the output into CDK or Terraform rather than treating the design as final — the prompt produces a blueprint, not deployable code.
  • Choose [api_type] deliberately; HTTP API is cheaper for plain REST while WebSocket or richer features may justify the costlier option, and that choice ripples through the rest of the design.

Frequently Asked Questions

Does this output deployable infrastructure code?
No — it produces an architecture design (endpoints, Lambda specs, data model, cost estimate) that you then translate into CDK or Terraform. Treating the output as a blueprint rather than final code is the intended workflow, which is why cost and capacity reasoning come first.
Will it help me decide between DynamoDB and Aurora Serverless?
Yes, it chooses between them based on your `[data_pattern]` and `[access_patterns]`, then designs the DynamoDB schema with partition keys, sort keys, and GSIs if that is the fit. Listing every access pattern up front is what makes the resulting key design sound.
Does it estimate cost?
It calculates a monthly cost for `[expected_load]` using the AWS pricing model so you can spot surprises before committing. Treat that number as a planning input and confirm it against the AWS pricing calculator before quoting it to anyone.
How does it handle Lambda cold starts?
It determines memory, timeout, and cold-start mitigation for `[latency_requirement]`, and can apply provisioned concurrency or SnapStart on latency-sensitive endpoints. Reserve those for endpoints that genuinely need the latency target, since applying them everywhere inflates the bill.
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 AWS & Cloud Architecture Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

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

mejba.13@gmail.com

✓ 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