Amazon EC2 インスタンスの状態変更イベント - Amazon Elastic Compute Cloud

Amazon EC2 インスタンスの状態変更イベント

インスタンスの状態が変化すると、Amazon EC2 は Amazon EventBridge に EC2 Instance State-change Notification イベントを送信します。

以下はこのイベントのサンプルデータです。この例では、インスタンスは pending 状態に入りました。

{ "id":"7bf73129-1428-4cd3-a780-95db273d1602", "detail-type":"EC2 Instance State-change Notification", "source":"aws.ec2", "account":"123456789012", "time":"2021-11-11T21:29:54Z", "region":"us-east-1", "resources":[ "arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1111" ], "detail":{ "instance-id":"i-abcd1111", "state":"pending" } }

state に指定できる値は、次のとおりです。

  • pending

  • running

  • stopping

  • stopped

  • shutting-down

  • terminated

インスタンスを起動または開始した場合、インスタンスは pending 状態に移行してから、running 状態になります。インスタンスを停止した場合、インスタンスは stopping 状態に移行してから、stopped 状態になります。インスタンスを終了した場合、インスタンスは shutting-down 状態に移行してから、terminated 状態になります。