Which combination of steps will meet these requirements?
(Choose two.)
Ensure that the Amazon CloudWatch agent is installed on all EC2 instances.
Create a cron job that is installed on each EC2 instance to periodically delete temporary files.
Create an Amazon CloudWatch log group for the EC2 instances. Configure a cron job that is installed on each EC2 instance to write the available disk space to a CloudWatch log stream for the relevant EC2 instance.
Create an Amazon CloudWatch alarm to monitor available disk space on all EC2 instances. Add the alarm as a safety control to the Systems Manager Automation task.
Create an AWS Lambda function to periodically check for sufficient available disk space on all EC2 instances by evaluating each EC2 instance’s respective Amazon CloudWatch log stream.
Explanations:
Installing the Amazon CloudWatch agent on all EC2 instances enables monitoring of metrics such as available disk space, which can be used for alerting and proactive management of disk space before patching tasks are executed.
Creating a cron job to delete temporary files may free up disk space, but it is not a scalable or monitored solution. It also does not integrate with Systems Manager Automation or provide visibility into disk space issues, making it insufficient to ensure space availability during patching.
Writing available disk space to a CloudWatch log stream does not directly address alerting or proactive management. Logs only store data without triggering alerts or actions, making this approach less effective in ensuring sufficient disk space during patching processes.
A CloudWatch alarm for available disk space can monitor disk utilization and trigger alerts when thresholds are breached. Adding it as a safety control to Systems Manager Automation ensures that patching tasks are halted or managed if disk space is insufficient, preventing EC2 instances from failing.
Using a Lambda function to periodically check disk space via CloudWatch logs adds unnecessary complexity and lag. CloudWatch alarms can natively monitor disk space in real-time, making this option redundant and less efficient.