Q46 — AWS SAA-C03 Ch.12

Question 46 of 100 | ← Chapter 12

Q846. A company is migrating a legacy application from an on-premises data center to AWS. The application relies on hundreds of cron jobs that run between 1 and 20 minutes on different recurring schedules throughout the day.The company wants a solution to schedule and run the cron jobs on AWS with minimal refactoring. The solution must support running the cron jobs in response to an event in the future.Which solution will meet these requirements?

Correct Answer: C. Create a container image for the cron jobs. Use Amazon EventBridge Scheduler to create a recurring schedule. Run the cron job tasks on AWS Fargate.

Explanation

The recommended solution to schedule and run cron jobs on AWS with minimal refactoring, supporting running the jobs in response to future events, is:C. Create a container image for the cron jobs. Use Amazon EventBridge Scheduler to create a recurring schedule. Run the cron job tasks on AWS Fargate.Here's why:Option C suggests creating a container image for the cron jobs and using Amazon EventBridge Scheduler to schedule the recurring events. The cron job tasks can be run on AWS Fargate.Amazon EventBridge Scheduler allows you to define recurring schedules for events. You can configure EventBridge Scheduler to trigger events at the desired intervals for each cron job.By running the cron job tasks on AWS Fargate, you can leverage the serverless compute capabilities of Fargate without needing to modify the existing cron job configurations significantly. Fargate eliminates the need to manage underlying infrastructure, providing a simplified deployment and scaling experience.Using a container image for the cron jobs allows you to package the existing cron job scripts or binaries into a container that can be executed by AWS Fargate. This approach helps minimize refactoring efforts as the cron job logic can be preserved with minimal modifications.Option A suggests using Amazon EventBridge Scheduler to create a recurring schedule and running the cron job tasks as AWS Lambda functions. While Lambda functions provide serverless compute, this option may require more refactoring efforts compared to running the tasks on Fargate.Option B suggests using AWS Batch on Amazon ECS with a scheduling policy to run the cron jobs. This option may involve significant modifications to the existing cron job configurations and scripts to fit into the Batch framework, making it less suitable for minimal refactoring requirements.Option D suggests using AWS Step Functions with a Wait state to run the cron jobs at a specified time and running the tasks on AWS Fargate using the RunTask action. This option introduces additional complexity with Step Functions, requiring more refactoring efforts compared to directly running the tasks on Fargate.Therefore, the recommended solution is to create a container image for the cron jobs, use Amazon EventBridge Scheduler to create a recurring schedule, and run the cron job tasks on AWS Fargate. This solution minimizes refactoring efforts, leverages serverless compute capabilities, and supports running the jobs in response to future events.