AWS · Amazon API Gateway · Diagram as code
AWS API Gateway architecture diagram
Show how HTTP or REST APIs front your backends. ArchLex validates API Gateway as an invokes source and as a CloudFront or Route 53 route target, then draws the official icon.
API Gateway with Lambda authorizer and handler.
One API invokes an authorizer and a route handler; the handler reads DynamoDB.
provider aws
direction LR
api: api-gateway["HTTP API"]
auth: lambda["Authorizer"]
handler: lambda["Route handler"]
table: dynamodb["Users"]
api -[invokes]-> auth
api -[invokes]-> handler
handler -[reads]-> tableCloudFront in front of API Gateway.
Terminate at CloudFront, then route API traffic to API Gateway.
provider aws
direction LR
cdn: cloudfront["CDN"]
api: api-gateway["HTTP API"]
fn: lambda["Handler"]
cdn -[routes]-> api
api -[invokes]-> fnPattern notes for Amazon API Gateway.
Placement and relationship rules ArchLex enforces for this service.
- Placement. API Gateway is regional edge compute. Keep it at the root or under account/region. Pair it with Lambda, HTTP backends, or authorizers in the same diagram.
- Valid connections. api-gateway -[invokes]-> lambda is the most common edge. CloudFront or Route 53 can -[routes]-> api-gateway. API Gateway can also -[exposes]-> lambda when you want that wording. Invalid endpoints surface AWS-RELATIONSHIP-INVALID-ENDPOINT-001.
- Authorizers and routes. Model an authorizer as another Lambda that the API invokes before the route handler. ArchLex checks the graph you declare; it does not infer mapping templates or usage plans.
Ask an agent to draw it.
Install the ArchLex skill or connect the free MCP server, then paste this prompt.
npx skills add baires/archlexDraw an AWS API Gateway architecture diagram with a Lambda authorizer, a route handler, and DynamoDB. Validate it and return a playground link.Prefer MCP? Follow the MCP server guide.
Related AWS examples.
- Serverless MicroserviceAPI Gateway invoking Lambda function accessing DynamoDB table
- Full-Stack Serverless Web ApplicationRoute 53 DNS, CloudFront CDN, S3 static assets, API Gateway, Lambda, and DynamoDB
- Async Fan-Out Event ProcessingAPI Gateway triggering SNS Topic fan-out to parallel SQS Queues for Email workers and Analytics S3 Data Lake
- AI/ML Model Inference PipelineCloudFront and API Gateway feeding Lambda preprocessor to EKS GPU inference cluster backed by ElastiCache and S3
Amazon API Gateway diagram questions.
How do I diagram Amazon API Gateway with ArchLex?
Use the api-gateway resource (aliases apigw and api_gateway). Connect it with -[invokes]-> to Lambda handlers or authorizers, and optionally put CloudFront or Route 53 in front with -[routes]->.
Can I show REST and HTTP APIs?
ArchLex uses one api-gateway catalog entry for both. Distinguish them with display labels such as ["HTTP API"] or ["REST API"] on the node.
Does ArchLex validate API Gateway routes and stages?
No. It checks declared resources and relationship kinds. Route keys, stages, usage plans, and mapping templates are outside the diagram graph.
Where is the API Gateway semantics reference?
See the https://docs.archlex.dev/specs/aws-semantics/ for AWS scopes, catalog entries, and relationship rules.
More AWS service diagrams.
Open source · MIT licensed