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
In a Usage Plan, how are throttling limits applied?
to the API Keys / the individual
What is the overall number of maximum requests?
Quota limit
What are the steps to configure a usage plan?
- Create API(s), configure methods to require an API key, and deploy the API(s) to stages
- Generate or import API keys to distribute to application developers (your customers) who will be using your API
- Create the usage plan with the desired throttle and quota limits
- Associate API stages and API keys with the usage plan
Callers of the API must supply an assigned API key in which header in requests to the API?
x-api-key
What CloudWatch metrics provide information on the efficiency of the cache?
CacheHitCount and CacheMissCount
What CloudWatch metric provides information on the total number of API requests in a given period?
Count
What CloudWatch metric provides information on the time between when API Gateway relays a request to the backend and when it receives a response from the backend?
IntegrationLatency