AWS Certified Developer – Associate / Question #587 of 557

Question #587

A company uses Amazon Cognito user pools to manage user identities for their application. The company has enabled multi-factor authentication (MFA) and now wants to automatically send a confirmation email to users immediately after they successfully sign up.

What is the MOST operationally efficient solution to meet this requirement?

A

Develop an AWS Lambda function that sends emails via Amazon Simple Email Service (Amazon SES). Use Amazon API Gateway to expose the function as an API. Invoke the API from the client application after the user completes the sign-up process.

B

Develop an AWS Lambda function that sends emails via Amazon Simple Email Service (Amazon SES). Configure an Amazon Cognito post-confirmation Lambda trigger to execute the function automatically upon successful user sign-up.

C

Develop an AWS Lambda function that sends emails via Amazon Simple Email Service (Amazon SES). Create an Amazon CloudWatch Logs subscription filter to trigger the function based on sign-up events logged by Amazon Cognito.

D

Set up Amazon Cognito to stream event logs to Amazon Kinesis Data Firehose. Develop an AWS Lambda function to process the logs and send confirmation emails when a new user sign-up event is detected.

Explanation

Answer B is correct because Amazon Cognito natively supports Lambda triggers for specific events, such as the post-confirmation trigger. This trigger automatically invokes a Lambda function after a user successfully signs up and confirms their account (e.g., via email or SMS). By configuring this trigger, the Lambda function sends the confirmation email via Amazon SES without needing extra services like API Gateway (A), CloudWatch Logs parsing (C), or Kinesis Data Firehose (D). These alternatives introduce unnecessary complexity, latency, or dependencies, making them less operationally efficient. Key points to remember: Cognito triggers enable seamless serverless automation, and the post-confirmation trigger is specifically designed for post-sign-up actions like sending confirmation emails.

Answer

The correct answer is: B