AWS Certified Developer – Associate (DVA-C02) — Question 238

A developer created a web API that receives requests by using an internet-facing Application Load Balancer (ALB) with an HTTPS listener. The developer configures an Amazon Cognito user pool and wants to ensure that every request to the API is authenticated through Amazon Cognito.

What should the developer do to meet this requirement?

Answer options

Correct answer: B

Explanation

The correct answer is B because it directly configures the ALB to authenticate requests using Amazon Cognito, ensuring that unauthenticated requests are denied. Option A only responds with an error if the Authorization header is missing but does not enforce authentication. Option C adds unnecessary complexity by introducing API Gateway when ALB can handle the authentication directly, and Option D relies on a Lambda function, which is less efficient than using built-in ALB authentication features.