API Gateway Flashcards

1
Q

what is amazon API Gateway

A

API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale

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

what can an API gateway do

A

Expose HTTPS endpoints to define a Restful API
Maintains multiple versions of your API
send each API endpoint to a different target
scale effortlessly
Track and control usage of API-key
Throttle requests to prevent attacks
Connect to CloudWatch to log all requests for monitoring
Run efficiently with low cost
serverless-ly connect to services like Lambda and Dynamo DB

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

How do you configure API Gateway

A

Define an API (container)
Defines Resources and nested Resources (URL Paths)
For each Resource
select supported HTTP methods(Verbs)
Set security
Choose target(such as EC2, Lambda, DynamoDB, etc)
It sets request and response transformations

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

How do I deploy API Gateway

A

Deploy API to a stage
Uses API GW domain, by default
Can use Custom domain
Now supports AWS Certificate Manager:free SSL/TLS certs

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

API Gateway Caching

A

API Gateway caches the response based on TTL set.. If the same request comes again, it returns the response from the cache instead of the calling the endpoint again

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

Same Origin Policy

A

In computing, same origin policy is an important concept in web application model.. Under the policy, a web browser permits scripts contained in a first web page to access data in second web page, but only if both web pages are from same origin.

This is done to prevent Cross-Site Scripting Attacks (XSS)
Enforced by web browsers
Ignored by tools like PostMan and curl

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

Cross Origin Resource Sharing ((CORS)

A

Cross Origin Resource sharing is a mechanism that allows restricted resources(eg.fonts) on a web page to be requested from a different domain from which the first resource was served

In amazon, we will be using different domain names, For s3 we use s3 domain name, for cloud front cloud front domain name, in api gw , by api gw domain name.

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
Q

CORS is enforced by the client

A

True

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