Q100 — AWS DOP-C02 Ch.1
Question 100 of 100 | ← Chapter 1
A company shares a single AWS account among multiple development teams. Development team managers want to automatically stop Amazon EC2 instances and receive notifications when resources are idle and not tagged as production resources.
- A. Use a scheduled Amazon CloudWatch Events rule to filter Amazon EC2 instance status checks and identify idle EC2 instances. Use the CloudWatch Events rule to target an AWS Lambda function to stop non-production instances and send notifications.
- B. Use a scheduled Amazon CloudWatch Events rule to filter AWS Systems Manager events and identify idle EC2 instances and resources. Use the CloudWatch Events rule to target an AWS Lambda function to stop non-production instances and send notifications.
- C. Use a scheduled Amazon CloudWatch Events rule to invoke a custom AWS Lambda function that runs AWS Trusted Advisor checks. Create a second CloudWatch Events rule to filter Trusted Advisor events to trigger a Lambda function to stop idle non-production instances and send notifications. ✓
- D. Use a scheduled Amazon CloudWatch Events rule targeting Amazon Inspector events for idle EC2 instances. Use the CloudWatch Events rule to target an AWS Lambda function to stop non-production instances and send notifications.
Correct Answer: C. Use a scheduled Amazon CloudWatch Events rule to invoke a custom AWS Lambda function that runs AWS Trusted Advisor checks. Create a second CloudWatch Events rule to filter Trusted Advisor events to trigger a Lambda function to stop idle non-production instances and send notifications.
Explanation
In this scenario, development team managers need to automatically stop idle and untagged-as-production Amazon EC2 instances and receive notifications when instances become idle. Option C provides a solution using a scheduled Amazon CloudWatch Events rule to invoke a custom AWS Lambda function that runs AWS Trusted Advisor checks. Trusted Advisor helps identify underutilized or idle Amazon EC2 instances. A second CloudWatch Events rule filters Trusted Advisor events to trigger a Lambda function that stops idle non-production instances and sends notifications. This approach satisfies the stated requirements, making C the correct answer.