Which solution will meet this requirement?
Assess AWS CloudTrail logs to verify that there is no EC2 API activity. Invoke an AWS Lambda function to stop the EC2 instances.
Create an Amazon CloudWatch alarm to stop the EC2 instances when the average CPU utilization is lower than 5% for a 30-minute period.
Create an Amazon CloudWatch metric to stop the EC2 instances when the VolumeReadBytes metric is lower than 500 for a 30-minute period.
Use AWS Config to invoke an AWS Lambda function to stop the EC2 instances based on resource configuration changes.
Explanations:
CloudTrail logs track API activity but do not directly manage EC2 instances. Lambda would need to be triggered manually based on CloudTrail data, which is inefficient for automated instance stopping.
A CloudWatch alarm based on CPU utilization is a practical solution to stop EC2 instances when the CPU utilization is low for an extended period, indicating that the instances are not in use.
The VolumeReadBytes metric tracks disk read activity and is not directly related to the overall instance usage for a resource-intensive application. Using this metric would be inappropriate for stopping instances based on inactivity.
AWS Config is primarily used to monitor configuration changes and compliance, not for real-time performance-based actions like stopping instances when they are not in use. Lambda triggered by configuration changes is not suitable in this scenario.