AWS API Gateway
AWS managed service for creating, publishing, and managing REST, HTTP, and WebSocket APIs that act as entry points to Lambda functions and other backend services.
seed#aws#api-gateway#serverless#rest#http#websocket
What it is
AWS API Gateway is a fully managed service that makes it easy to create APIs as entry points to applications. It handles authentication, authorization, throttling, caching, and monitoring — letting Lambda focus only on business logic.
API types
| Type | Characteristics | Cost |
|---|---|---|
| HTTP API | Simple, low latency, Lambda integration | Cheaper |
| REST API | Full features, transformations, validation | More expensive |
| WebSocket API | Real-time bidirectional connections | Per message |
Key features
| Feature | Function | Example |
|---|---|---|
| Stages | Environments with independent configuration | dev, staging, prod |
| Authorizers | Authentication and authorization | Lambda, Cognito, IAM |
| Throttling | Requests per second limits | 10,000 rps per stage |
| Caching | Cached responses | Reduce latency and cost on stable endpoints |
| CORS | Cross-origin configuration | Allow requests from frontend |
| Custom domains | Own domains with SSL | api.example.com with ACM |
Typical pattern
Client → API Gateway → Lambda → DynamoDB
↓
Authorizer (JWT/Cognito)
Why it matters
API Gateway eliminates the need to build and operate your own HTTP entry layer. With native Lambda integration, Cognito/IAM authorization, and automatic throttling, it enables exposing serverless APIs in production without managing servers.
References
- API Gateway Documentation — Official documentation.
- HTTP API vs REST API — AWS, 2024. Comparison between API Gateway types.
- API Gateway Pricing — AWS, 2024. Pricing model.