📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AWS Solutions Architect API Gateway — Managed REST APIs

API Gateway — Managed REST APIs

4 min read Quiz at the end
Learn REST vs HTTP APIs, authentication options, throttling, caching, and the standard serverless API architecture pattern.

API Gateway — Create and Manage APIs

API Gateway is a fully-managed service for creating REST APIs, HTTP APIs, and WebSocket APIs. It handles authentication, throttling, caching, and routing — so you focus on your Lambda functions, not the API plumbing.

Teacher Note: API Gateway is the front door of your serverless application. It is like a receptionist who: checks who is calling (authentication), limits how many calls can come in (throttling), remembers recent answers (caching), and directs calls to the right person (routing to Lambda or backend services).

REST API vs HTTP API

FeatureREST APIHTTP API
CostMore expensive70% cheaper
FeaturesFull-featured: usage plans, request/response transforms, caching, WAFSimple: JWT auth, CORS, Lambda integration
PerformanceSlightly higher latencyLower latency
Best ForComplex APIs needing all featuresMost Lambda APIs — recommended default

Key Features

  • Authentication: Cognito User Pools (JWT), Lambda Authorizer (custom logic), API Keys
  • Throttling: rate limiting per API key or globally — prevents abuse and runaway costs
  • Caching: cache GET responses for configurable TTL — reduces Lambda invocations
  • Stage Variables: deploy same API to dev/staging/prod with different Lambda aliases
  • Usage Plans: monetise your API — different plans with different rate limits for customers

Common Serverless API Pattern

Client --> HTTPS --> API Gateway --> Lambda --> DynamoDB

With auth:
Client --> HTTPS --> API Gateway --> [Cognito Authorizer] --> Lambda --> DynamoDB
                                         |
                              Validates JWT token
                              Rejects invalid tokens
                              Returns 401 Unauthorized
Exam Tip: HTTP API is the recommended choice for most new Lambda-backed APIs. It is simpler, cheaper, and faster. Choose REST API only when you need: request/response transformation, API caching, WAF integration, or usage plans for monetisation.
Topic Quiz · 1 questions

Test your understanding before moving on

1. A company wants to create a simple REST API backed by Lambda functions. They need JWT authentication and CORS support but no advanced features. Which API Gateway type is BEST?
💡 HTTP API is 70% cheaper than REST API and supports JWT authentication and CORS — the recommended choice for simple Lambda-backed APIs.