本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
Amazon EC2 執行個體的狀態變更事件
Amazon EC2 會在執行個體狀態變更時將 EC2 Instance State-change Notification
事件傳送至 Amazon EventBridge。
以下是此事件的範例資料。在本範例中,執行個體進入 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
狀態。