title: Will an Amazon EC2 Instance State-change Notification be triggered when an instance enters or leaves a provided state?
body: <p>So if I have the following definition for a CloudWatch Event:</p>
  
  <pre><code>{
    "source": [
      "aws.ec2"
    ],
    "detail-type": [
      "EC2 Instance State-change Notification"
    ],
    "detail": {
      "state": [
        "pending"
      ]
    }
  }
  </code></pre>
  
  <p>Will AWS trigger this event when an EC2 Instance enters the <code>pending</code> state, or when an EC2 Instance in the <code>pending</code> state changes to a different state?</p>
  
  <p>I'm looking for an authoritative answer, as the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#ec2_event_type" rel="nofollow noreferrer">AWS Documentation</a> is unclear as to which it is.</p>