
Answer-first summary for fast verification
Answer: Design an AWS Lambda function that converts the .csv files into images and stores the images in the S3 bucket. Invoke the Lambda function when a .csv file is uploaded., Create S3 Lifecycle rules for .csv files and image files in the S3 bucket. Transition the .csv files from S3 Standard to S3 One Zone-Infrequent Access (S3 One Zone-IA) 1 day after they are uploaded. Expire the image files after 30 days.
## Explanation **Correct Answers: B and D** **Why B is correct:** - AWS Lambda is serverless and cost-effective for event-driven processing - Lambda functions are triggered immediately when .csv files are uploaded to S3 - This provides near-real-time conversion of .csv files to images - No need to pay for idle compute resources (unlike EC2) - Pay only for the compute time used during conversion **Why D is correct:** - S3 One Zone-IA is cost-effective for infrequently accessed data - .csv files are only needed twice a year for ML training - Transitioning to S3 One Zone-IA after 1 day saves costs compared to S3 Standard - Expiring image files after 30 days aligns with the requirement that images become irrelevant after 1 month - S3 One Zone-IA is cheaper than S3 Standard-IA and appropriate for data that can be recreated **Why other options are incorrect:** **A:** EC2 Spot Instances are not cost-effective for this use case because: - Requires polling every hour (inefficient) - Not event-driven (delayed processing) - EC2 instances would be running idle between processing cycles - More complex to manage than Lambda **C:** S3 Glacier is not appropriate because: - ML trainings are planned weeks in advance, but Glacier has retrieval delays - Glacier is for archival storage with retrieval times of minutes to hours - More expensive retrieval costs compared to S3 One Zone-IA **E:** S3 Standard-IA is more expensive than S3 One Zone-IA - Reduced Redundancy Storage (RRS) is deprecated and not recommended - S3 Standard-IA maintains data in multiple AZs, which is unnecessary for .csv files that can be recreated **Key Cost Optimization Principles:** 1. **Use serverless compute (Lambda)** for event-driven processing 2. **Use appropriate storage classes** based on access patterns 3. **Implement lifecycle policies** to automatically transition data to cheaper storage 4. **Automatically expire unnecessary data** to avoid storage costs
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A manufacturing company has machine sensors that upload .csv files to an Amazon S3 bucket. These .csv files must be converted into images and must be made available as soon as possible for the automatic generation of graphical reports. The images become irrelevant after 1 month, but the .csv files must be kept to train machine learning (ML) models twice a year. The ML trainings and audits are planned weeks in advance.
Which combination of steps will meet these requirements MOST cost-effectively? (Choose two.)
A
Launch an Amazon EC2 Spot Instance that downloads the .csv files every hour, generates the image files, and uploads the images to the S3 bucket.
B
Design an AWS Lambda function that converts the .csv files into images and stores the images in the S3 bucket. Invoke the Lambda function when a .csv file is uploaded.
C
Create S3 Lifecycle rules for .csv files and image files in the S3 bucket. Transition the .csv files from S3 Standard to S3 Glacier 1 day after they are uploaded. Expire the image files after 30 days.
D
Create S3 Lifecycle rules for .csv files and image files in the S3 bucket. Transition the .csv files from S3 Standard to S3 One Zone-Infrequent Access (S3 One Zone-IA) 1 day after they are uploaded. Expire the image files after 30 days.
E
Create S3 Lifecycle rules for .csv files and image files in the S3 bucket. Transition the .csv files from S3 Standard to S3 Standard-Infrequent Access (S3 Standard-IA) 1 day after they are uploaded. Keep the image files in Reduced Redundancy Storage (RRS).