Running Stateful Jobs on AWS Fargate with EventBridge

SAA-C03 By islever Editorial Last updated

Short answer

A Schedule an Amazon ECS task on AWS Fargate using EventBridge Scheduler to run the containerized job without interruption risk.

Question

A company runs a critical data analysis job each week before the first day of the work week. The job requires at least 1 hour to complete the analysis. The job is stateful and cannot tolerate interruptions. The company needs a solution to run the job on AWS. Which solution will meet these requirements?
  1. Create a container for the job. Schedule the job to run as an AWS Fargate task on an Amazon Elastic Container Service (Amazon ECS) cluster by using Amazon EventBridge Scheduler. Correct Answer
  2. Configure the job to run in an AWS Lambda function. Create a scheduled rule in Amazon EventBridge to invoke the Lambda function.
  3. Configure an Auto Scaling group of Amazon EC2 Spot Instances that run Amazon Linux. Configure a crontab entry on the instances to run the analysis.
  4. Configure an AWS DataSync task to run the job. Configure a cron expression to run the task on a schedule.

Key Takeaways

The core trap is ignoring the 'stateful' and 'cannot tolerate interruptions' constraints, which immediately disqualifies Spot Instances and short-lived serverless functions like Lambda.

This question evaluates the selection of AWS compute services for stateful, long-running scheduled tasks. The correct solution leverages Amazon ECS on AWS Fargate to ensure uninterrupted execution beyond Lambda's time limits.

Common mistake: Many candidates choose Lambda (Option B) because it is easy to schedule, failing to notice that its maximum execution timeout is 15 minutes, which is insufficient for a 1-hour job.

Expert Analysis

Why the Answer Is Correct

Option A is the only viable choice because AWS Fargate provides a serverless compute engine for containers that supports longer execution times without the interruption risks associated with Spot Instances. By using Amazon ECS, the containerized job can run for the required hour or more while maintaining state. Amazon EventBridge Scheduler is the appropriate service to trigger this task on a weekly schedule.

Why the Other Options Are Wrong

Option B fails because AWS Lambda has a maximum execution timeout of 15 minutes, making it impossible to complete a 1-hour job in a single invocation. Option C is incorrect because Amazon EC2 Spot Instances can be interrupted by AWS with only a two-minute warning, violating the requirement that the job cannot tolerate interruptions. Option D is invalid because AWS DataSync is a data transfer service, not a general-purpose compute platform for running custom analysis jobs.

Community Comment Notes

Community consensus strongly supports Option A. As user Hkayne noted, "B is wrong because the job takes 1 hour and the lambda maximum execution time is 15 minutes." Another commenter emphasized that Spot instances are unreliable for stateful workloads: "C is wrong can't use spot instances because the job can not tolerate interruptions." Users also correctly identified that DataSync is not designed for launching arbitrary jobs.

Official Reference

Exam Strategy

Always check the execution duration limits of serverless options like Lambda before selecting them for long-running tasks. For stateful jobs, avoid Spot Instances unless you have implemented robust checkpointing and restart logic, as they are not guaranteed to stay running.

Frequently Asked Questions

Why can't I use AWS Lambda for a 1-hour job?

AWS Lambda has a maximum synchronous execution timeout of 15 minutes. Even with asynchronous invocation, processing a single continuous 1-hour stateful task is not supported.

Is Amazon EventBridge Scheduler better than CloudWatch Events?

EventBridge Scheduler is the newer, simplified scheduling service recommended for creating cron-based schedules for various AWS targets including ECS tasks, replacing older CloudWatch Events patterns.

More SAA-C03 FAQ →

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 5 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 5

  1. Hkayne 👍 5 Answered A
    B is wrong because the job takes 1 hour and the lambda maximum execution time is 15 minutes. C is wrong can't use spot instances because the job can not tolerate interruptions. D iswrong too because DataSync is not designed to lunch jobs. Correct answer is A
  2. Scheldon 👍 4 Answered A
    Answer: A Fargate is compatibilie with ECS and is allowing for log running tasks
  3. mk168898 👍 1
    B is not because lambda only max 15mins but job requires 1 hour C is not because cannot tolerate interruptions, spot instance might be gone anytime. D datasync doesn't seem correct A is most correct
  4. muhammadahmer36 👍 1 Answered A
    A. Create a container for the job. Schedule the job to run as an AWS Fargate task on an Amazon Elastic Container Service (Amazon ECS) cluster by using Amazon EventBridge Scheduler.
  5. 744fdad 👍 1
    I know datasync and lambda is event based, there are interruptions. C, doesnt address the scheduling requirement. Has to be A

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All SAA-C03 Questions

Access 120 questions with complete answers and detailed explanations.

View Full SAA-C03 Practice Test →

← Back to SAA-C03 Study Guide