Question #583
A company hosts a static website on Amazon S3, delivered through Amazon CloudFront. The website interacts with an Amazon API Gateway REST API backed by AWS Lambda functions. The company needs a biweekly CSV report detailing each API Lambda function’s recommended memory configuration, associated cost savings, and the cost difference compared to the current setup. The reports must be stored in an S3 bucket.
Which solution meets these requirements with the LEAST development effort?
Develop a Lambda function to collect performance metrics for each Lambda function from Amazon CloudWatch Metrics over a 2-week period. Transform the data into a CSV format and save it to S3. Use an Amazon EventBridge rule to trigger the Lambda function every 2 weeks.
Enable AWS Compute Optimizer. Create a Lambda function that invokes the GetLambdaFunctionRecommendations API to retrieve optimization data. Format the results into a CSV file and store it in S3. Schedule the function using an Amazon EventBridge rule every 2 weeks.
Activate AWS Compute Optimizer. Configure a recurring export job directly from the Compute Optimizer console to generate a CSV report every 2 weeks and save it to the S3 bucket.
Upgrade to the AWS Enterprise Support plan. Use AWS Trusted Advisor to export cost optimization checks for Lambda functions into a CSV file. Schedule the export job via the Trusted Advisor console to run every 2 weeks and store the output in S3.
Explanation
Answer B is correct because AWS Compute Optimizer automatically generates optimization recommendations for Lambda functions, including memory configuration and cost savings. By invoking the GetLambdaFunctionRecommendations API, a Lambda function can retrieve this data, format it into CSV, and store it in S3. This approach minimizes development effort compared to manually calculating metrics (Option A) or relying on unscheduled exports (Option C). Option D is incorrect because Trusted Advisor does not provide Lambda memory-specific recommendations, and upgrading to Enterprise Support is unnecessary. Key points: Use AWS Compute Optimizer for automated recommendations, leverage its API for data retrieval, and schedule via EventBridge for biweekly execution.
Answer
The correct answer is: B