API Gateway Flashcards
1
Q
Name four backend services that API Gateway can communicate with.
A
- Lambda
- Step Function
- EC2
- Elastic Beanstalk
2
Q
In API Gateway, what is API caching?
A
- It means that you Gateway caches your endpoint’s response.
- API Gateway then responds to a request by looking up the endpoint response from the cache instead of making a request to your endpoint.
- The response is cached for some TTL
- This can reduce the number of call made to your endpoint and improve the latency of the requests to your API
3
Q
What is Same Origin Policy?
A
- Under the policy, a web browser permits scripts contained in a first web page to access data in a second web page, but only if both web pages have the same origin.
- This is done to prevent Cross-Site Scripting attacks (XSS)
- Enforced by web browsers
- Ignored by tools like Postman and curl
4
Q
How can the Same Origin Policy be relaxed?
A
- By Cross-Origin Resource Sharing (CORS)
- With CORS, one server allows another server outside of the first servers domain to access restricted resources on the first server
5
Q
Does API Gateway scale?
A
Yes, API Gateway scales automatically.
6
Q
Name one way API Gateway uses to prevent attacks.
A
API Gateway can throttle to prevent attacks.
7
Q
How can you import APIs to API Gateway?
A
- Using the “API Gateway Import” feature.
- Allows you to import external definition files
- Currently, the Import API feature supports Swagger v2.0 definition files and Open API 3
- You can either create a new API by submitting a POST request that includes a Swagger definition in the payload and endpoint configuration
- or, you can update an existing API by using a PUT request that contains a Swagger definition in the payload
- You can update an API by overwriting it with a new definition, or merge a definition with an existing API
- You specify the options using a mode query parameter in the request URL
8
Q
What are the two default throttling limits used by API Gateway?
A
- 10.000 request per second or 5.000 concurrent requests
- These values are across ALL you APIs within an AWS account (or maybe it’s just for the 5.000?)
- You will receive a 429 Too Many Request error response if you go over any of these values
9
Q
Can API Gateway act as a SOAP web service passthrough?
A
Yes.
10
Q
Can you increase the throttling limit for API Gateway?
A
Yes, contact AWS Support.
11
Q
How/in what order are throttling rules applied?
A
- First, API Gateway checks against your account limit.
- If the traffic is below the set account limit, API Gateway checks the limit you have set on a stage or method.
- If the traffic is below the stage limit, then API Gateway applies the usage plans limits you set on per-API key basis.