23. API Gateway **IMPORTANT** Flashcards
What are the API Gateway endpoint types?
- Edge-Optimized (default)
- Regional
- Private
You made changes to the API Gateway but they’re not showing up – why?
You need to make a “deployment” for API Gateway changes to be in effect
When would you use a Stage variable in API Gateway?
- to configure your HTTP endpoints your stages talk to (dev, test, prod)
- to pass configuration parameters to AWS Lambda through mapping templates
Stage variables are passed to which object in AWS Lambda?
Stage variables are passed to the “context” object in AWS Lambda
If you wanted to change the percentage of traffic sent to a stage, what would you use?
Canary deployment
Used in blue/green deployments
What are the API Gateway Integration Types?
- MOCK
- HTTP / AWS (Lambda & AWS Services)
- AWS_PROXY (Lambda Proxy)
- HTTP_PROXY
What is the MOCK Integration Type?
API Gateway returns a response without sending the request to the backend
How do you configure the HTTP/AWS Integration Type?
- you must configure both the integration request and the integration response
- setup data mapping using mapping templates for the request and response
How do you configure the AWS_PROXY Integration Type?
no mapping template
incoming request from the client is the input to Lambda
headers, query string parameters are passed as arguments
the function is responsible for the logic of request / response
How do you configure the HTTP_PROXY Integration Type?
no mapping template
the HTTP request is passed to the backend
the HTTP response from the backend is forwarded by API gateway
What do you use to modify request / responses for AWS & HTTP integration?
Mapping Templates
What is the default cache TTL?
300 seconds
What is the max cache TTL?
1 hour (3600 seconds)
What header can clients use to invalidate the cache (with proper IAM authorization)?
Cache-Control: max-age=0
What should you use to make an API available as an offering ($) for your customers?
a Usage Plan
How does a Usage Plan identify API clients and meter access?
API Keys
What is an API Key?
an alphanumeric string value to distribute to customers that can be used with a usage plan to control access