Rob Rose
Rob Rose

Reputation: 1962

Will an Amazon EC2 Instance State-change Notification be triggered when an instance enters or leaves a provided state?

So if I have the following definition for a CloudWatch Event:

{
  "source": [
    "aws.ec2"
  ],
  "detail-type": [
    "EC2 Instance State-change Notification"
  ],
  "detail": {
    "state": [
      "pending"
    ]
  }
}

Will AWS trigger this event when an EC2 Instance enters the pending state, or when an EC2 Instance in the pending state changes to a different state?

I'm looking for an authoritative answer, as the AWS Documentation is unclear as to which it is.

Upvotes: 0

Views: 2241

Answers (1)

Dušan Brejka
Dušan Brejka

Reputation: 862

AWS will trigger this event when an EC2 Instance enters the pending state.

Quote from AWS documentation:

An instance enters the pending state when it launches for the first time, or when it is restarted after being in the stopped state.

After the instance is ready for you, it enters the running state

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html#instance-launch

Upvotes: 1

Related Questions