What this prompt does
This prompt designs a serverless AWS architecture for a stated [application_purpose]. It lays out API Gateway plus Lambda for [api_endpoints], DynamoDB tables modeled around your [access_patterns], S3 for [storage_use], EventBridge for [event_flows], Step Functions for [workflows], Cognito auth, CloudFront, SQS dead-letter queues, CloudWatch dashboards and alarms, and infrastructure as code with [iac_tool]. It also covers cold-start optimization, a cost estimate for [monthly_requests] per month, and a Mermaid architecture diagram, designed for [availability].
The structure works because serverless rewards event-driven thinking and punishes ad-hoc design. By forcing you to declare [access_patterns] up front, it pushes correct single-table DynamoDB modeling instead of relational habits that scale badly. Mapping [event_flows] and [workflows] to EventBridge and Step Functions keeps orchestration explicit and reproducible through [iac_tool]. Modeling cold starts and cost for [monthly_requests] up front is what stops a serverless design from surprising you on the latency or the bill.
When to use it
- A spiky or unpredictable workload where you want to pay per request, not for idle servers.
- An event-driven backend (file processing, notifications) that maps to Lambda and Step Functions.
- Designing DynamoDB tables and you want access-pattern-first modeling, not relational guesswork.
- Estimating monthly cost for
[monthly_requests]before committing to serverless. - Producing a reproducible architecture in
[iac_tool]rather than click-ops in the console. - Communicating a design to stakeholders with a clear Mermaid diagram.
Example output
You get a structured architecture: a component-by-component breakdown (API Gateway, Lambda, DynamoDB table designs keyed to [access_patterns], S3, EventBridge rules, Step Functions definition, Cognito, CloudFront, SQS DLQs, CloudWatch), [iac_tool] scaffolding, a cold-start optimization section, a cost estimate for [monthly_requests], optional VPC notes, a CI/CD outline, and a Mermaid diagram you can paste into docs.
Pro tips
- Define
[access_patterns]precisely; DynamoDB design is only as good as the queries you list, and adding patterns later is painful. - Be realistic about
[monthly_requests]; the cost estimate is only as accurate as that input. - Use cold-start optimization (provisioned concurrency) selectively; it costs money, so apply it to latency-sensitive endpoints only.
- Keep
[iac_tool]consistent with your team's skills; CDK suits TypeScript teams, SAM suits simpler stacks. - Treat the cost estimate as a model, not a quote; validate against the AWS pricing calculator for your region.
- Wire the SQS dead-letter queues early; silent failures in event flows are the hardest serverless bugs to find.