Building APIs with Amazon API Gateway
Deploying Applications on AWS
Dunieski Otano
Amazon Web Services Solutions Architect
Three clients, one backend
Web, mobile, and a partner all call one backend
Each speaks a slightly different format
A front door validates and transforms every caller
What API Gateway does
A
fully managed front door
for your APIs
Handles routing, auth, throttling, and transformation
Sits between clients and your
backend
Backends: Lambda, HTTP endpoints, or AWS services
Integration types
Lambda proxy
: passes the whole request to Lambda
Lambda non-proxy
: you map request and response fields
HTTP
: forwards to an HTTP backend
MOCK
: returns a response with no backend at all
Request and response transformations
Mapping templates
reshape payloads with VTL
Velocity Template Language transforms body, headers, params
Request mapping
: client format to backend format
Response mapping
: backend format to client format
Request validation
Reject bad input
before
it reaches the backend
Required parameters
: headers, query strings, paths
Model schemas
: validate the JSON body shape
Validate body, parameters, or both
Status codes and error contracts
Override backend status codes for a
consistent contract
Map a backend 502 to a clean 503 for clients
Gateway responses
: customize error bodies
Clients get predictable errors regardless of backend
Putting it together
Client request →
validation
→ transformation → backend
Bad input rejected at the gate
Good input reshaped for the backend
Backend response reshaped into the client contract
Let's practice!
Deploying Applications on AWS
Preparing Video For Download...