An application uses an Amazon Cognito user pool for authentication. You need to add a new REST API that authenticates requests using that user pool with the least amount of development effort. Which approach should you choose?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Cognito authorizer for the appropriate user pool and reference the header that contains the Cognito token..
Why this is the answer
Creating a Cognito authorizer for the appropriate user pool is the most straightforward and least effort solution. AWS API Gateway natively integrates with Amazon Cognito user pools, allowing you to secure your REST API endpoints directly by configuring a Cognito authorizer. This authorizer automatically validates the JSON Web Token (JWT) provided in the request header against the specified Cognito user pool, granting access only if the token is valid and unexpired. Incorrect options: Creating an API key and a usage plan provides throttling and monitoring but does not authenticate users against a Cognito user pool. API keys are for identifying API consumers, not for user authentication. Creating a Lambda token authorizer or a Lambda request authorizer would work, but both require writing and maintaining custom Lambda code to perform the token validation against Cognito, which is more development effort than using the native Cognito authorizer.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed