Front-End Web and Mobile
Amazon API Gateway
Service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. It acts as the "front door" to backend logic, for example AWS Lambda functions or applications on Amazon EC2.
Exam phrases that point here
«expose Lambda functions as an HTTPS API for web and mobile applications»
API Gateway is the managed front door of an API: it receives HTTPS requests, maps them to routes and methods, and calls the backend (Lambda, HTTP, Step Functions…), adding authorization, throttling, and monitoring.
When not: If the backend is EC2 instances or containers that only need HTTP traffic distributed, with no API keys, usage plans, or authorizers, an Application Load Balancer may be enough.
«limit how many requests each client makes and hand out API keys to external developers»
Usage plans associate API keys with throttling limits and quotas per client, and measure the usage of each key.
When not: API keys identify and measure; they are not for authorizing. To control access, use IAM (Signature Version 4), an Amazon Cognito authorizer, or a Lambda authorizer.
«real-time two-way communication, such as a chat or a live dashboard»
A WebSocket API keeps persistent connections and lets the backend send messages to each connected client through its callback URL.
When not: If you only need to notify people by email, SMS, or push with no open connection, Amazon SNS fits. WebSocket messages have a maximum size (128 KB according to the FAQ).
«reduce latency and backend load by caching API responses»
A REST API can have a cache per stage, with TTL and cache keys configurable per method; repeated requests are answered without reaching the backend.
When not: Caching belongs to REST APIs, not HTTP APIs. For globally distributed static content, Amazon CloudFront fits, and for caching database queries, Amazon ElastiCache or DAX.
«only users authenticated in an Amazon Cognito user pool can call the API»
An authorizer of type COGNITO_USER_POOLS validates the token that the client sends in the Authorization header before calling the backend.
When not: If the tokens come from another OIDC or OAuth 2.0 provider, a JWT authorizer validates them without writing code; if the authorization logic is custom or the credentials are not JWTs, use a Lambda authorizer; if the caller has AWS credentials, IAM with Signature Version 4.
«the API must only be reachable from inside a VPC»
A private API is published only through VPC endpoints, and its resource policy can restrict access to a VPC or to a specific endpoint.
When not: It is different from a private integration: if the API is public but the backend lives in private subnets, what you use is a VPC link to a load balancer in the VPC.
Often paired with
- AWS Lambda
- Amazon Cognito