Q30 — AWS SOA-C02 Ch.1

Question 30 of 100 | ← Chapter 1

A company decides to stop non-production Amazon EC2 instances during the night. The company's IT manager must receive notification in near real time whenever an EC2 instance that has an environment type tag value of non-production is started during the night. Which solution will meet this requirement with the MOST operational efficiency?

Correct Answer: C. Create an Amazon EventBridge rule that includes the EC2 Instance State-change Notification event type. Filter the event to capture only the running state. Create an AWS Lambda function as a target of the rule. Configure the Lambda function to check the current time and the EC2 instances’ tags to determine the environment type. Create an Amazon Simple Notification Service (Amazon SNS) topic as a target of the Lambda function for notifications. Subscribe the IT manager's email address to the SNS topic.

Explanation

这道题考察有效监控EC2实例状态变化并触发通知的架构设计,涉及AWS事件驱动服务的使用。根据AWS架构最佳实践文档,事件驱动的无服务器模式在实时性和资源效率上优于轮询方案。EventBridge可直接捕获EC2状态变化事件,避免了轮询API的开销(排除选项B/D)。Lambda函数仅在事件触发时运行,结合时间判断和标签过滤,确保仅处理夜间启动的非生产实例,减少无效执行。SNS作为托管服务处理通知逻辑,比SMTP库(选项A)或自定义应用(选项D)更可靠。选项C通过集成多个托管服务,在事件响应、资源利用和维护成本上达到最优。