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 for running highly CPU-intensive applications, as it has limited CPU power (allocated in 1-second increments) and a maximum timeout of 15 minutes, which is less than the 20-minute runtime required for the application.
AWS Batch is designed for batch processing workloads and can be an effective solution for compute-intensive jobs. However, using AWS Step Functions to trigger AWS Batch every 4 hours introduces unnecessary complexity, as AWS Batch can be directly scheduled without Step Functions.
AWS Fargate is well-suited for running stateless applications like the one described, especially for CPU-intensive workloads. EventBridge can trigger the Fargate task every 4 hours, and Fargate automatically handles resource allocation, making it an optimal choice.
Amazon EC2 Spot Instances can be used to reduce costs, but they are not ideal for stateless applications that must run reliably on a fixed schedule. Spot instances can be interrupted, which may affect the predictable execution of the application. AWS CodeDeploy is more suited for deployment scenarios, not for scheduling periodic tasks.