
Answer-first summary for fast verification
Answer: Create an AWS Lambda function based on the container image of the job. Configure Amazon EventBridge to invoke the function every 10 minutes.
## Explanation **Correct Answer: A** **Why Option A is the most cost-effective solution:** 1. **AWS Lambda with container image support**: AWS Lambda now supports container images as deployment packages, which allows you to run Windows containers with .NET 6 Framework. 2. **Pay-per-use pricing model**: Lambda charges based on: - Number of invocations - Duration of execution (rounded up to the nearest 1ms) - Memory allocated For a job that runs every 10 minutes for only 1-3 minutes each time, this is highly cost-effective because: - You only pay for the actual execution time (1-3 minutes every 10 minutes) - No charges when the function is idle - No minimum billing period 3. **EventBridge scheduling**: Amazon EventBridge can schedule Lambda invocations precisely every 10 minutes with minimal cost. **Why other options are less cost-effective:** **Option B (AWS Batch with Fargate)**: - AWS Fargate has a minimum billing duration of 1 minute, but you're paying for the entire container runtime - Additional overhead for job scheduling and management - Generally more expensive for short, frequent jobs **Option C (ECS on Fargate with scheduled tasks)**: - Similar to Option B, Fargate charges for the entire container runtime - ECS scheduled tasks still require the container to be provisioned and running - Less cost-effective for short-duration jobs **Option D (ECS on Fargate with Windows task scheduler)**: - This would require the container to run continuously to use Windows task scheduler - Most expensive option as you're paying for 24/7 container runtime - Completely defeats the purpose of cost optimization **Key Considerations:** - The job runs very infrequently (every 10 minutes) and for short durations (1-3 minutes) - Lambda's pay-per-use model is ideal for this pattern - Windows container support in Lambda makes this feasible - No need to manage infrastructure or pay for idle time **Cost Comparison:** - **Lambda**: Pay only for ~3 minutes of execution every 10 minutes - **Fargate-based solutions**: Pay for at least the container runtime, plus additional overhead - **Continuous container**: Pay for 24/7 operation regardless of actual job execution
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company containerized a Windows job that runs on .NET 6 Framework under a Windows container. The company wants to run this job in the AWS Cloud. The job runs every 10 minutes. The job's runtime varies between 1 minute and 3 minutes.
Which solution will meet these requirements MOST cost-effectively?
A
Create an AWS Lambda function based on the container image of the job. Configure Amazon EventBridge to invoke the function every 10 minutes.
B
Use AWS Batch to create a job that uses AWS Fargate resources. Configure the job scheduling to run every 10 minutes.
C
Use Amazon Elastic Container Service (Amazon ECS) on AWS Fargate to run the job. Create a scheduled task based on the container image of the job to run every 10 minutes.
D
Use Amazon Elastic Container Service (Amazon ECS) on AWS Fargate to run the job. Create a standalone task based on the container image of the job. Use Windows task scheduler to run the job every 10 minutes.