ANS-C01 Question 323
Single answerAn organization uses Amazon VPC and wants to automate network changes based on specific events, such as a new EC2 instance being launched or terminated. They want to ensure that the route tables in a specific subnet are automatically updated to reflect these changes. Which solution provides an event-driven approach to achieve this?
- A
Use an Amazon CloudWatch alarm to detect changes in instance state and trigger an Amazon SNS topic that updates the route tables.
- B
Create an AWS Lambda function triggered by Amazon EventBridge (CloudWatch Events) rules for EC2 instance state changes to modify the route tables.
- C
Manually monitor EC2 instance state changes and update the route tables using the AWS Management Console.
- D
Use Amazon S3 events to detect changes in the VPC and trigger an AWS Lambda function to update the route tables.
Show answer and explanation
Correct answer: B
Explanation
Event-driven automation in AWS can be achieved using Amazon EventBridge (CloudWatch Events) to detect changes in resource states, such as EC2 instance launches or terminations, and trigger AWS Lambda functions to perform necessary network updates. This approach eliminates the need for manual intervention and ensures that the network remains up-to-date based on specific events.
- A. Incorrect.
Amazon CloudWatch alarms are used to monitor metrics and thresholds, not for detecting specific events like EC2 instance state changes. This solution is not suitable for event-driven automation of network changes.
- B. Correct.
Amazon EventBridge (formerly CloudWatch Events) is specifically designed to capture resource state changes, such as EC2 instance launches or terminations. By triggering an AWS Lambda function, you can automate updates to the route tables, making this the correct solution.
- C. Incorrect.
Manually monitoring EC2 instance state changes and updating route tables is not event-driven automation. This approach is manual and does not fulfill the requirements of the question.
- D. Incorrect.
Amazon S3 events are used for monitoring object-level activities in S3 buckets. They cannot detect VPC or EC2 instance changes, so this option is not applicable.