Skip to Content

SOA-C02: What is the MOST operationally efficient solution to notify operations team whenever EC2 instance state changes

Question

A company runs its applications on a large number of Amazon EC2 instances. A SysOps administrator must implement a solution to notify the operations team whenever an EC2 instance state changes. What is the MOST operationally efficient solution that meets these requirements?

A. Create a script that captures instance state changes and publishes a notification to an Amazon Simple Notification Service (Amazon SNS) topic. Use AWS Systems Manager Run Command to run the script on all EC2 instances.
B. Create an Amazon EventBridge event rule that captures EC2 instance state changes. Set an Amazon Simple Notification Service (Amazon SNS) topic as the target
C. Create an Amazon EventBridge event rule that captures EC2 instance state changes. Set as the target an AWS Lambda function that publishes a notification to an Amazon Simple Notification Service (Amazon SNS) topic.
D. Create an AWS Config custom rule that evaluates instance state changes with automatic remediation. Use the rule to invoke an AWS Lambda function that publishes a notification to an Amazon Simple Notification Service (Amazon SNS) topic.

Answer

C. Create an Amazon EventBridge event rule that captures EC2 instance state changes. Set as the target an AWS Lambda function that publishes a notification to an Amazon Simple Notification Service (Amazon SNS) topic.

Explanation

The MOST operationally efficient solution that meets these requirements is to create an Amazon EventBridge event rule that captures EC2 instance state changes and sets an Amazon Simple Notification Service (Amazon SNS) topic as the target.

Option A is not as efficient because it requires the creation and maintenance of a script, which can be complex and time-consuming. Additionally, this option would require the script to be run on all EC2 instances periodically, which could add latency and overhead.

Option B is not as efficient as Option C because it requires the creation of a custom AWS Lambda function. Additionally, this option would require the Lambda function to publish a notification to an SNS topic, which could add latency and overhead.

Option D is not as efficient as Option C because it requires the creation of a custom AWS Config rule and an AWS Lambda function. Additionally, this option would require the Lambda function to publish a notification to an SNS topic, which could add latency and overhead.

To create an Amazon EventBridge event rule that captures EC2 instance state changes and sets an Amazon SNS topic as the target, follow these steps:

  1. Open the Amazon EventBridge console.
  2. Click Rules.
  3. Click Create rule.
  4. Select Event pattern and then click Next.
  5. In the Event pattern section, select the following options:
    • Event source: AWS Services
    • Service: EC2
    • Event type: EC2 Instance State-change Notification
  6. Click Next.
  7. In the Targets section, select SNS topic.
  8. Select the SNS topic to which you want to receive notifications.
  9. Click Next.
  10. Review the rule and then click Create rule.

Once the rule is created, Amazon EventBridge will start monitoring for EC2 instance state changes. Whenever an instance state change occurs, Amazon EventBridge will publish an event to the SNS topic that you specified. You can then configure SNS to send notifications to the operations team via email, SMS, or another messaging platform.

Additional benefits of using Amazon EventBridge with an SNS topic:

  • Amazon EventBridge is a fully managed service, so you don’t need to worry about managing the infrastructure required to run the rule.
  • Amazon EventBridge is highly scalable, so it can monitor EC2 instances in large AWS accounts efficiently.
  • Amazon EventBridge can deliver notifications in real time, so the operations team can be notified of EC2 instance state changes immediately.

Overall, using Amazon EventBridge with an SNS topic is the most operationally efficient solution for notifying the operations team whenever an EC2 instance state changes.

Reference

Amazon AWS Certified SysOps Administrator – Associate certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified SysOps Administrator – Associate exam and earn Amazon AWS Certified SysOps Administrator – Associate certification.