API Gateway Flashcards

1
Q

What does API Gateway do

A

Helps expose Lambda, HTTP & AWS Services as an API

You can have API versioning, authorization, traffic management, and so on

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

What are some limits to know for API Gateway

A

29 seconds timeout

10MB max payload size

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

What are the types of integrations with API Gateway

A

HTTP
Expose HTTP endpoints in the backend. Example: Put behind a ALB to limit rate or caching or user authentications

Lambda Function
Invoke Lambda to do something

AWS Service
Example start a stepfunction, post a message to SQS

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

What are the endpoint types in which you can use in deploying your API Gateway

A

Edge-Optimized (Default): For global clients, requests are routed through cloudfront edge locations (closer to the users) this reduces the latency experienced by clients when making API requests because the data doesn’t have to travel as far.

Regional: For clients in the same region

Private: Can only be accessed from your VPC using an endpoint and a resource policy

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

How can you reduce the number of calls made to your backend

A

By caching API responses. The Default TTL is 300secs

You can encrypt the cache

And the capacity of the cache is between 0.5GB to 237GB

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

What does a 4xx type API Gateway Error mean

A

400: Bad Request
403: Access Denied, WAF filtered
429: Quota exceeded, Throttle

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

What does a 5xx type API Gateway Error mean

A

502: Bad Gateway Exception (Backend Server Unavailability, timeout or Backend Server Error)

503: Service Unavailable Exception (API gateway understands the request, cannot connect to the backend)

504: Integration Failure (Usually timeout. It did not receive a response in time)

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

What are three ways you can do authentication for API Gateway

A

IAM based access

Lambda Authorizer

Cognito User Pools

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

Explain API Gateway Logging capability

A

Use CloudWatch Logs by stage to log full request and responses

You can send API Gateway Access Logs

You can send logs directly to Kinesis Data Firehose

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

Explain API Gateway Metric capability

A

Use cloudwatch metrics by stage

Some of the CW metrics are:
IntegrationLatency
Latency
CacheHitCount
CacheMissCount

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

Explain API Gateway Tracing capability

A

You can use X-Ray to enable tracing to get extra information about requests in API Gateway

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

What is the API Gateway Usage Plan

A

API Gateway usage plan is a feature to enable if you want to make an API available to your customers. The Usage Plan defines the following:

Who can access your deployed API stages and methods
How much and how fast they can access them
Uses API keys to identify API clients and meter access
Configure throttling and quota limits per client

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

What are API keys and how are they used in API gateway

A

API keys are used to identify your customers. They are alphanumeric string values that are used to distribute to your customers. You can use with usage plans to control access. You can set throttling limits and quota limits at the key level

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

API Gateway has a feature called WebSocket API. What is it

A

It is a two-way interactive communication between a user browser and a server.

Server can push information to the client.

It is often used in chat applications, games, financial trading platforms etc.

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