title: CloudWatch Events trigger on shutdown of EC2 instance only if it has a certain tag
body: <p>I am attempting to trigger a Lambda function when a CloudWatch event detects an EC2 Server that has shutdown. I need this function only to trigger when the EC2 instance contains a certain tag doing this via CloudWatch Events Rules.  In this case, the tag I am using is called nameOfTheTag.</p>
  
  <p>The below JSON is valid for CloudWatch but is not triggering for some reason</p>
  
  <pre><code>{
    "source": [
      "aws.ec2"
    ],
    "detail-type": [
      "EC2 Instance State-change Notification"
    ],
    "detail": {
      "state": [
        "stopped"
      ],
      "tags:nameOfTheTag": [
        "example"
      ]
    }
  }
  </code></pre>