API Gateway Flashcards

1
Q

What is API Gateway?

A

Amazon API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as applications running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any web application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

API gateway architecture

A

User makes a request through API gateway, which triggers a Lambda function or routes request to EC2 instances. That request is then cached at API gateway, so subsequent requests would return the cached endpoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is API caching?

A

Can enable API caching to cache your endpoint’s response. with caching, you can reduce the number of calls made to your endpoint and also improve the latency of the requests to your API. when you enable caching for a stage, API gateway caches responses from your endpoint for a specified TTL period in seconds. API gateway then responds to the request by looking up the endpoint from the cache instead of making a request to your endpoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What can API gateway do?

A

Low cost and efficient, scales effortlessly (w/o autoscaling groups or EC2 servers but can cause security concerns), you can throttle requests to prevent attacks, connect to CloudWatch to log requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Same origin policy

A

In computing, the same-origin policy is an important concept in the web app security model. 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/domain name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Cross-Origin Resource Sharing (CORS)

A

CORS is one way the server at the other end (not the client) can relax the same-origin policy.

It is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside of the domain from which the first resource was served

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Error: “Origin policy cannot be read at the remote resource”

A

You need to enable CORS on API gateway

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

T/F: API gateway has caching capabilities to increase performance

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

T/F: API gateway is low cost and scales automatically.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If you are using Javascript/AJAX that uses multiple domains with API gateway,

A

ensure you have enabled CORS on API Gateway

How well did you know this?
1
Not at all
2
3
4
5
Perfectly