Which solution will meet these requirements MOST cost-effectively?
Configure an Amazon EventBridge scheduled rule to invoke a script every minute on a long-running Amazon EMR cluster. Configure the script to generate thumbnails for the photos that do not have thumbnails. Configure the script to upload the thumbnails to the second S3 bucket.
Configure an Amazon EventBridge scheduled rule to invoke a script every minute on a memory-optimized Amazon EC2 instance that is always on. Configure the script to generate thumbnails for the photos that do not have thumbnails. Configure the script to upload the thumbnails to the second S3 bucket.
Configure an S3 event notification to invoke an AWS Lambda function each time a user uploads a new photo to the application. Configure the Lambda function to generate a thumbnail and to upload the thumbnail to the second S3 bucket.
Configure S3 Storage Lens to invoke an AWS Lambda function each time a user uploads a new photo to the application. Configure the Lambda function to generate a thumbnail and to upload the thumbnail to a second S3 bucket.
Explanations:
Running a long-running Amazon EMR cluster incurs high costs due to the instance charges and is inefficient for processing individual photo uploads. Using a scheduled rule to check for new photos every minute is not the best use of resources when a direct event-driven solution is available.
A memory-optimized Amazon EC2 instance that is always on would also incur continuous costs, making it an expensive solution. Similar to option A, using a scheduled script adds latency and unnecessary costs when an event-driven approach can respond immediately to new uploads.
Using an S3 event notification to trigger an AWS Lambda function allows for immediate processing of each uploaded photo, generating a thumbnail on-the-fly. Lambda operates on a pay-as-you-go basis, making it the most cost-effective option for processing each upload without incurring charges for idle resources.
S3 Storage Lens is primarily used for monitoring and reporting S3 usage and performance; it does not invoke Lambda functions directly based on S3 events. Therefore, it cannot fulfill the requirement of generating thumbnails upon photo uploads.