Bird
0
0

Given this EventBridge rule JSON snippet, what will happen when an EC2 instance state changes to 'stopped'?

medium📝 Predict Output Q13 of 15
AWS - CloudWatch
Given this EventBridge rule JSON snippet, what will happen when an EC2 instance state changes to 'stopped'?
{
  "Source": ["aws.ec2"],
  "DetailType": ["EC2 Instance State-change Notification"],
  "Detail": {"state": ["stopped"]}
}
AThe rule triggers only when an EC2 instance stops
BThe rule triggers for any EC2 state change
CThe rule triggers only when an EC2 instance starts
DThe rule never triggers
Step-by-Step Solution
Solution:
  1. Step 1: Analyze event pattern

    The pattern filters events from source 'aws.ec2' with detail type 'EC2 Instance State-change Notification' and detail state 'stopped'.
  2. Step 2: Understand filtering effect

    Only events where the instance state changes to 'stopped' match this pattern, so the rule triggers only then.
  3. Final Answer:

    The rule triggers only when an EC2 instance stops -> Option A
  4. Quick Check:

    Detail state filter 'stopped' triggers only on stop = A [OK]
Quick Trick: Detail filters limit triggers to specific event states [OK]
Common Mistakes:
  • Assuming all EC2 state changes trigger the rule
  • Confusing 'stopped' with 'started' state
  • Ignoring the detail filter in the event pattern

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes