A Lambda function generates avatars for profile images uploaded to an S3 bucket under the /original/ prefix. Some images cause the avatar generator to time out. The developer wants a fallback that resizes the image using a second Lambda function when the generator fails. Which approach accomplishes this with the least development effort?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure the image-resize Lambda function as a destination for the avatar-generator Lambda function for failed invocations..
Why this is the answer
Configuring the image-resize Lambda function as a destination for failed invocations of the avatar-generator Lambda is the most straightforward and least effort solution. AWS Lambda's asynchronous invocation model natively supports configuring a destination for successful or failed invocations, allowing direct routing of the failed event payload to the fallback function without additional orchestration. Using an SQS queue or SNS topic as an on-failure destination would require the image-resize Lambda to be configured to poll the SQS queue or subscribe to the SNS topic, adding an extra layer of integration and management. While valid, these options introduce more components and configuration than a direct Lambda destination. An AWS Step Functions state machine would provide robust orchestration and retry logic but represents significantly more development effort and complexity than simply configuring a Lambda destination for failed invocations.
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