AWS Certified Developer Associate · Free Practice Question Medium
Question 20
A Developer is writing an AWS Lambda function that processes records from an Amazon Kinesis Data Stream. The Developer must write the function so that it sends a notice to Administrators if it fails to process a batch of records.
How should the Developer write the function?
-
A
Push the failed records to an Amazon SQS queue
-
B
Use Amazon CloudWatch Events to send the processed data
-
C
Separate the Lambda handler from the core logic
-
D
Configure an Amazon SNS topic as an on-failure destination
Reveal correct answer
Correct answer: D
Explanation
With Destinations, you can route asynchronous function results as an execution record to a destination resource without writing additional code. An execution record contains details about the request and response in JSON format including version, timestamp, request context, request payload, response context, and response payload.
For each execution status such as Success or Failure you can choose one of four destinations: another Lambda function, SNS, SQS, or EventBridge. Lambda can also be configured to route different execution results to different destinations.
In this scenario the Developer can publish the processed data to an Amazon SNS topic by configuring an Amazon SNS topic as an on-failure destination.
CORRECT: "Configure an Amazon SNS topic as an on-failure destination" is the correct answer.
INCORRECT: "Separate the Lambda handler from the core logic" is incorrect as this will not assist with sending a notification to administrators.
INCORRECT: "Use Amazon CloudWatch Events to send the processed data" is incorrect as CloudWatch Events is used for tracking state changes, not forwarding execution results
INCORRECT: "Push the failed records to an Amazon SQS queue" is incorrect as SQS will not notify the administrators, SNS should be used.
References:
https://aws.amazon.com/blogs/compute/introducing-aws-lambda-destinations/
Save time with our AWS cheat sheets:
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
