

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 「資源狀態變更」事件詳細資訊
<a name="event-detail-resource-status-change"></a>

以下是「資源狀態變更」事件的詳細資訊欄位。

包含 `source`和 `detail-type` 欄位，因為其中包含事件的特定值。

```
{
  . . .,
  "detail-type": "CloudFormation Resource Status Change",
  "source": "aws.cloudformation",
  . . .,
  "detail": {
    "stack-id" : "string",
    "logical-resource-id" : "string",
    "physical-resource-id": "string",
    "status-details": {
        "status": "string",
        "status-reason": "string"
    },
     "resource-type": "string",
     "client-request-token": "string"
  }
}
```

`detail-type`  <a name="resource-status-change-detail-type"></a>
識別事件的類型。  
若是資源狀態事件，此值為 `CloudFormation Resource Status Change`。

`source`  <a name="resource-status-change-source"></a>
識別產生事件的服務。若是 CloudFormation 事件，此值為 `aws.cloudformation`。

`detail`  <a name="resource-status-change-detail"></a>
包含事件相關資訊的 JSON 物件。產生事件的服務會決定此欄位的內容。  
若是資源狀態事件，此資料包括：    
`stack-id`  <a name="resource-status-change-stack-id"></a>
與堆疊關聯的唯一的堆疊 ID。  
`logical-resource-id`  <a name="resource-status-change-logical-resource-id"></a>
範本中指定的資源邏輯名稱。  
`physical-resource-id`  <a name="resource-status-change-physical-resource-id"></a>
與 CloudFormation 支援之資源的實體執行個體 ID 對應的名稱或唯一識別碼。  
`status-details`  <a name="resource-status-change-status-details"></a>  
`status`  <a name="resource-status-change-status"></a>
資源狀態。  
`status-reason`  <a name="resource-status-change-status-reason"></a>
資源的狀態原因。  
`resource-type`  <a name="resource-status-change-resource-type"></a>
資源類型。例如 `AWS::S3::Bucket`。  
`client-request-token`  <a name="resource-status-change-client-request-token"></a>
用於呼叫 API 的存取權杖。針對特定堆疊操作啟動的所有事件，系統會指派相同的用戶端請求權杖，您即可透過該權杖追蹤操作。為了讓您能輕鬆地辨識堆疊操作，從主控台啟動的堆疊操作皆會採用 *Console-StackOperation-ID* 字符格式。舉例來說，若您使用主控台建立堆疊，則系統將指派相同字符給每個產生的堆疊事件，該字符格式如下所示：`Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002`。

**Example 範例：「資源狀態變更」事件**  <a name="event-detail-resource-status-change.example"></a>
下列為範例資源狀態事件。此事件詳細說明了 CloudFormation 已在指定堆疊中成功建立請求的資源 (Amazon S3 儲存貯體)。  

```
{
    "version":"0",
    "id":"6a7e8feb-b491-4cf7-a9f1-bf3703467718",
    "detail-type":"CloudFormation Resource Status Change",
    "source":"aws.cloudformation",
    "account":"111122223333",
    "time":"2017-12-22T18:43:48Z",
    "region":"us-west-1",
    "resources":[
        "arn:aws:cloudformation:us-west-1:111122223333:stack/teststack"
    ],
    "detail":{
        "stack-id":"arn:aws:cloudformation:us-west-1:111122223333:stack/teststack",
        "logical-resource-id":"my-s3-bucket",
        "physical-resource-id":"arn:aws:s3:::my-s3-bucket-us-east-1",
        "status-details":{
            "status":"CREATE_COMPLETE",
            "status-reason":""
        },
        "resource-type":"AWS::S3::Bucket",
        "client-request-token":""
    }
}
```