Which strategy should the solutions architect use?
Use AWS Lambda to run the application. Use Amazon CloudWatch Logs to invoke the Lambda function every 4 hours.
Use AWS Batch to run the application. Use an AWS Step Functions state machine to invoke the AWS Batch job every 4 hours.
Use AWS Fargate to run the application. Use Amazon EventBridge (Amazon CloudWatch Events) to invoke the Fargate task every 4 hours.
Use Amazon EC2 Spot Instances to run the application. Use AWS CodeDeploy to deploy and run the application every 4 hours.
Explanations:
AWS Lambda is not suitable because it has a memory and execution time limit (15 minutes max execution time). The application runs for up to 20 minutes and requires 2 GB of RAM, making Lambda an inappropriate choice.
AWS Batch is typically used for managing batch jobs at scale, but since the application is single-threaded, highly CPU intensive, and only runs for a short time (20 minutes every 4 hours), it is overkill. Additionally, AWS Batch introduces unnecessary complexity for this use case.
AWS Fargate is well-suited for stateless applications. It allows you to run containers without managing the underlying infrastructure. Fargate supports CPU and memory configurations that fit the application’s needs, and Amazon EventBridge (CloudWatch Events) can be used to schedule the task every 4 hours.
Amazon EC2 Spot Instances are suitable for cost-saving but are not optimal here because the application runs periodically and has strict timing requirements. Using EC2 instances introduces management overhead, and CodeDeploy is generally used for application deployment, not scheduling periodic tasks.