What does “deploying” your API Gateway achieve?
Makes the API Gateway accessible as an HTTP endpoint (an “invoke” URL)
API Gateway Resource vs. API Gateway Method
Resource is an object or collection of objects represented by a URL path, like: {api-id}.execute-api-us.west2-amazon.aws.com/books
A Method is the HTTP VERB that acts on the Resource NOUN
Flavors of API Gateway Integration Requests / Responses
API Gateways connection to the client (Method Requests and Responses) are not subdivided
The backend connections can be to Lambda, HTTP endpoints, or AWS Services. The “Integration Request” and “Integration Response” can be Lambda (Custom or Proxy), HTTP (Custom or Proxy), or Mock (for testing purposes
Three types of API Gateway authentication methods
IAM Roles and Policies
Cognito User Pools
Lambda Authorizers (both token-based and request parameter-based)
Permissions / Steps to allow a user to invalidate an API Gateway cache
CW Monitoring of API Execution (Latency): overall responsiveness, backend responsiveness
Overall: LATENCY metric. Backend: INTEGRATION LATENCY metric
Key function / slogan of API Gateway. What does it do?
“Expose any AWS Service to the outside world.”
Chief Value of API Gateway for each of the three backend integrations
Lambda: easiest way to connect a REST API to a Lambda function
HTTP: API Gateway can add rate limiting, caching, user authorization, API keys, etc. to backend URL
AWS Service: Authorization, public access, rate control
Most common meaning of a “Bad Gateway 502” error on a Lambda Proxy Integration
The format the Lambda function returned doesn’t match what’s needed to be passed to the client (maybe XML vs. JSON)
Purpose of API Gateway’s STAGE Variables
Allow you to parameterize / adjust the behavior of APIs during runtime without redeploying the APIG. Useful in any multi-environment API Gateway set up. You set the key-value stage variables in API Gateway, then reference them in mapping templates or other client-side structures.
API Request Limit and Throttling Error Code
10,000 requests / second or 5,000 concurrent requests
429 Too Many Requests
What is the API Gateway cache capacity?
0.5 GB - 237 GB
Steps to create an API Gateway
What is a “Request Validation” in the API Gateway context?
A configuration to get API Gateway to test / validate an API request (headers / body / query string, etc.) without bothering the backend. Returns a 400 error if there is an issue.
Four API Gateway error messages to know: 403 Access Denied, 429 Throttle, 502 Bad Gateway, 504
403 may mean filtered by WAF
429 throttle
502 Bad Gateway (often an incompatible response / output from
backend)
504 Endpoint Timeout (29s) – this is not changeable for a Lambda backend. Can be changed for HTTPS backends, up to 50 s
Three API Gateway Endpoint Types