How can the user configure this with CloudWatch?
Configure a job which terminates all instances after 600 minutes
It is not possible to terminate instances automatically
Configure the CloudWatch action to terminate the instance when the CPU utilization falls below 5%
Set up the CloudWatch with Auto Scaling to terminate all the instances
Explanations:
Terminating all instances after a fixed duration (600 minutes) does not guarantee that the batch process is completed, as the process may finish sooner or take longer.
It is possible to automate the termination of instances using CloudWatch; therefore, this option is misleading.
Configuring a CloudWatch action to terminate the instance when CPU utilization falls below a certain threshold (e.g., 5%) allows for automatic termination when the instance is no longer actively processing tasks, assuming low CPU usage indicates task completion.
While Auto Scaling can terminate instances, it does not specifically ensure that instances are only terminated after the batch process is complete. This method lacks direct correlation to the job’s completion status.