[DEVELOPER] Advanced API Gateway Flashcards

(27 cards)

1
Q

What is the preferred and simpler integration type when integrating API Gateway with AWS Lambda?

A

Lambda Proxy Integration

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

What is the major difference between Lambda Proxy and Lambda Non-Proxy (Custom) Integration.

A
  • Proxy passes the entire request/response AS IS (all headers, body, etc.).
  • Non-Proxy requires mapping templates to transform the data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the use case to use a VPC Link with API Gateway?

A

To connect API Gateway to private resources (like an ALB or NLB) located inside a VPC, allowing private connectivity without routing traffic over the public internet.

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

What happens if the Mapping Template fails in a Lambda Non-Proxy Integration?

A

The request will fail before the Lambda function is ever invoked.

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

What are the four types of API Gateway Authorizers?

A
  1. IAM Roles/Policies
  2. Cognito User Pools
  3. Lambda Authorizers (Custom).
  4. JWT Authorizers (ONLY IN HTTP APIs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the use case to use an API Gateway IAM Authorizer?

A

When the client is an authenticated AWS service or an IAM User

(e.g., an EC2 instance making a request using its attached role).

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

What is the use case to use an API Gateway Cognito User Pool Authorizer?

A

When the client is a mobile or web application user that has authenticated via AWS Cognito

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

What is the use case to use an API Gateway Lambda Authorizer?

A

When you need custom logic to validate a token or credentials

(e.g., integrating with a third-party OAuth provider or a custom legacy authentication system).

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

How do you optimize the latency of an API Gateway Authorizer?

A

Configure the caching period for the authorization response

(e.g., cache the result for 300 seconds).

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

How can you control access rates, define throttling limits, and monetize your API for third-party developers?

A

By configuring a Usage Plan and requiring clients to use API Keys.

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

What is the purpose of an API Key in API Gateway?

A

It is a token that a client must include in their requests to identify the client and manage their access according to a Usage Plan.

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

What is the difference between throttling limits configured on the Stage vs. the Usage Plan?

A

Usage Plan limits (Client-Side) override Stage limits (Server-Side), and Usage Plans are used for individual API consumers.

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

What is the maximum size of a request body that API Gateway supports?

A

10 MB

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

What is the first step required to make an API available to clients after making changes?

A

It must be deployed to a Stage.

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

What is the primary service used to monitor the performance metrics, latency, and cache hit ratio of API Gateway?

A

Amazon CloudWatch

(look for Latency, 4XXErrors, and CacheHitCount metrics).

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

You receive many 4XX errors for your API. What is the most likely cause?

A

Client-side errors

(e.g., incorrect resource path, missing authentication header, or throttling limits exceeded).

17
Q

You receive many 5XX errors for your API. What is the most likely cause?

A

Server-side errors

(e.g., Lambda function failures, or integration timeouts/errors).

18
Q

What are the two types of API supported by API Gateway? What is the difference in use case between them?

A
  1. REST APIs are feature-rich
  2. HTTP APIs are cheaper and support JWT Authorization natively
19
Q

Do API Gateway HTTP APIs support Usage Plans, API Keys, and Throttling?

20
Q

Do API Gateway REST APIs support Usage Plans, API Keys, and Throttling?

21
Q

Do API Gateway HTTP APIs support JWT Authorization tokens natively?

22
Q

Do API Gateway REST APIs support JWT Authorization Tokens natively?

A

No

You’ll need custom logic

23
Q

A developer needs to configure an API Gateway to route requests to different Lambda functions based on a version number in the header. What is the best way?

A

Use API Gateway Stage Variables.

24
Q

A developer needs to configure a custom endpoint for API Gateway that terminates the connection with a mutual TLS (mTLS) requirement. Which component is responsible for verifying the client certificate?

A

The API Gateway Custom Domain Name configuration

25
A developer is creating a REST API using API Gateway. The API must support multiple versions (e.g., v1, v2) accessible via different URLs. What is the most efficient way to achieve this?
Clone the API definition and deploy it to a new Stage, OR use distinct Resource paths (e.g., /v1, /v2) in a single API. ## Footnote Using distinct resource trees (/v1/users, /v2/users) allows side-by-side execution in the same stage, or cloning creates a clean separation.
26
What is the maximum execution duration for an API Gateway Lambda proxy integration before it times out?
**29 seconds**
27
You are using API Gateway. You want to route requests to different backend endpoints based on a header value (e.g., x-client-type). Which feature is best?
Use a Lambda function as a proxy to route the request logic. ## Footnote API Gateway does not natively support conditional routing to different integrations based on headers (unlike ALB). You typically route to a Lambda which then calls the appropriate logic, or use multiple resources.