API Gateway Flashcards

1
Q

What is API Gateway

A

Application Programming Interface Gateway. Fully managed service that. makes it easy for developers to publish, maintain, monitor or secure API. Easily create an API that acts as a “front door” for apps to access data, business logic or functionality from backend service.

  • Apps running on EC2
  • Code running on Lambda
  • Or any webapp
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What kind of API does API Gateway support?

A

RESTful API.

Uses JSON

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

How does API Gateway prevent attacks

A

Throttles requests

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

What services can API Gateway connect to serverlessly?

A

Lambda

DynamoDB

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

Monitoring Service for API Gateway

A

CloudWatch

CloudWatch Logs

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

What is API Caching

A

API Gateway allow to cache endpoint response. This reduces the number of calls made to an endpoint and can improve latency of API requests. These caches have TTLs.

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

Describe Same Origin Policy

A

Web browser permits scripting contained in 1st webpage to access data on 2nd webpage (but only if webpages have the same orgin)

This is done to prevent cross-site scripting (XSS) attacks

Enforced by web browsers

Must set up CORS for this

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

What is CORS

A

Cross Origin Resource Sharing

relax same-origin policy

Broswer makes HTTP OPTIONS Orgin Policy error means need to connect CORS

If using JS/Ajax and use multiple domains w? API gateway ensure you have enabled CORS

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

Who enforces CORS

A

the client

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

How to import API from an external definition file into API Gateway

A

Swagger v2.0 definition file

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

How to create a new API with external definition file

A

submit POST request include Swagger definition in payload and endpoint config

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

How to update an existing API with external definition file

A

PUT request. Contain Swagger definition in payload.

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

How to specify options in API call

A

Add query param in request URL

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

Default limit steady state rate request API Gateway

A

10000 requests per sec (rps)

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

Max concurrent requests API Gateway

A

5000 across all APIs w/in AWS account

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

What happens if you go over the max steady state rate or concurrent request rate in API Gateway

A

receive a 439 TooManyRequestError response

17
Q

Can API Gateway support SOAP APIs

A

API Gateway can be configured as a SOAP web service passthrough

and

API Gateway can convert XML responses recieved from SOAP API to JSON

18
Q

What does it mean if you receive an HTTP 504 error in API Gateway

A

Integration Timeout

Could be a Lambda function is timing out (running for more than 29 seconds)

19
Q

How to make API available for certain environment (prod, test, dev)

A

API stage

20
Q

What 2 types of proxy integration are there in API Gateway

A

HTTP proxy

Lambda proxy

21
Q

What are common things that API Gateway can do

A

Execute Lambda code

Start Step Functions state machines

Call Elastic Beanstalk

Call EC2

Call web services outside AWS with HTTP endpoint

22
Q

How to run multiple versions of API at same time in API Gateway

A

API Lifecycle

23
Q

Does API Gateway support HTTP endpoints, HTTPS, or both?

A

Only HTTPS endpoints

24
Q

What service should you use if you want to trace and analyze user requests through API Gateway

A

AWS X-Ray

25
Q

What Integration Type should you use if you want Lambda proxy integration?

A

AWS_PROXY

26
Q

What Integration Type should you use if you want Lambda custom integration?

A

AWS

27
Q

What Integration Type should you use if you want HTTP (API GATEWAY) proxy integration

A

HTTP_PROXY

28
Q

What Integration type should you use if you want custom HTTP (APIGateway) integration?

A

HTTP

29
Q

Valid API Gateway Lambda Authorizers (2)

A

Token-based

Request parameter based (combo of headers, query string params, stageVariables and $context variables)