Question #1502
A company containerized a Windows application built on the .NET 8 Framework to run as a periodic task in the AWS Cloud. The task executes every 15 minutes, with each run lasting between 2 and 4 minutes. Which solution is MOST cost-effective for this workload?
Deploy the application as an AWS Lambda function using the container image. Configure Amazon EventBridge to trigger the Lambda function every 15 minutes.
Use AWS Batch with AWS Fargate compute resources. Schedule the job using Amazon EventBridge to run every 15 minutes.
Run the application on Amazon Elastic Container Service (Amazon ECS) using AWS Fargate. Configure a scheduled task to execute the container every 15 minutes.
Deploy the application on Amazon EC2 instances using the container image. Use a cron job on the EC2 instance to trigger the task every 15 minutes.
Explanation
Option C is correct because Amazon ECS with AWS Fargate allows running containerized tasks on a serverless infrastructure, ensuring costs are incurred only during the 2-4 minute execution window every 15 minutes. Fargate natively supports Windows containers, making it suitable for the .NET 8 application.
Option A is incorrect because AWS Lambda does not support Windows-based container images, limiting it to Linux runtimes. Option B (AWS Batch with Fargate) adds unnecessary complexity for a simple periodic task, as AWS Batch is optimized for large-scale batch workloads. Option D (EC2 with cron) requires maintaining an always-on EC2 instance, leading to higher costs for idle time. ECS scheduled tasks are purpose-built for this scenario, offering simplicity and cost-efficiency by avoiding resource over-provisioning.
Answer
The correct answer is: C