

支援終止通知：2025 年 11 月 13 日， AWS 將停止對 AWS Elemental MediaStore 的支援。2025 年 11 月 13 日之後，您將無法再存取 MediaStore 主控台或 MediaStore 資源。如需詳細資訊，請造訪此[部落格文章](https://aws.amazon.com/blogs/media/support-for-aws-elemental-mediastore-ending-soon/)。

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

# 使用 記錄 AWS Elemental MediaStore API 呼叫 AWS CloudTrail
<a name="logging-using-cloudtrail"></a>

AWS Elemental MediaStore 已與 服務整合 AWS CloudTrail，此服務提供由使用者、角色或 MediaStore 中的 AWS 服務所採取之動作的記錄。CloudTrail 會將 MediaStore 的 API 呼叫子集擷取為事件，包括來自 MediaStore 主控台的呼叫，以及來自對 MediaStore API 的程式碼呼叫。如果您建立線索，則可以將 CloudTrail 事件持續交付至 Amazon S3 儲存貯體，包括 MediaStore 的事件。即使您未設定追蹤，依然可以透過 CloudTrail 主控台中的**事件歷史記錄**檢視最新事件。使用 CloudTrail 收集的資訊，您可以判斷向 MediaStore 提出的請求、提出請求的 IP 地址、提出請求的人員、提出請求的時間等等。

若要進一步了解 CloudTrail，包括如何設定及啟用，請參閱[《AWS CloudTrail 使用者指南》](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)。

**Topics**
+ [CloudTrail 中的 AWS Elemental MediaStore 資訊](monitoring-service-info-in-cloudtrail.md)
+ [範例：AWS Elemental MediaStore 日誌檔案項目](monitoring-example-log-file-entries.md)

# CloudTrail 中的 AWS Elemental MediaStore 資訊
<a name="monitoring-service-info-in-cloudtrail"></a>

當您建立 AWS 帳戶時，會在您的帳戶上啟用 CloudTrail。當 AWS Elemental MediaStore 中發生支援的事件活動時，該活動會與**事件歷史記錄**中的其他 AWS 服務事件一起記錄在 CloudTrail 事件中。您可以在 AWS 帳戶中檢視、搜尋和下載最近的事件。如需詳細資訊，請參閱《使用 CloudTrail 事件歷史記錄檢視事件》[https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

若要持續記錄您 AWS 帳戶中的事件，包括 MediaStore 的事件，請建立追蹤。線索能讓 CloudTrail 將日誌檔案交付至 Amazon S3 儲存貯體。根據預設，當您在主控台建立線索時，線索會套用到所有 AWS 區域。線索會記錄 AWS 分割區中所有區域的事件，並將日誌檔案傳送到您指定的 Amazon S3 儲存貯體。此外，您可以設定其他 AWS 服務，以進一步分析和處理 CloudTrail 日誌中所收集的事件資料。如需詳細資訊，請參閱下列主題：
+ [建立追蹤的概觀](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail 支援的服務和整合](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
+ [設定 CloudTrail 的 Amazon SNS 通知](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html)
+ [從多個區域接收 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html)，以及[從多個帳戶接收 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

AWS Elemental MediaStore 支援將下列操作記錄為 CloudTrail 日誌檔案中的事件：
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_CreateContainer.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_CreateContainer.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_DeleteContainer.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_DeleteContainer.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_DeleteContainerPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_DeleteContainerPolicy.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_API_DeleteCorsPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_API_DeleteCorsPolicy.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_DescribeContainer.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_DescribeContainer.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_GetContainerPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_GetContainerPolicy.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_GetCorsPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_GetCorsPolicy.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_ListContainers.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_ListContainers.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_PutContainerPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_PutContainerPolicy.html)
+ [https://docs.aws.amazon.com/mediastore/latest/apireference/API_PutCorsPolicy.html](https://docs.aws.amazon.com/mediastore/latest/apireference/API_PutCorsPolicy.html)

每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項：
+ 是否使用根使用者或使用者登入資料提出請求
+ 提出該請求時，是否使用了特定角色或聯合身分使用者的臨時安全憑證
+ 請求是否由其他 AWS 服務提出

如需詳細資訊，請參閱 [CloudTrail userIdentity 元素](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)。

# 範例：AWS Elemental MediaStore 日誌檔案項目
<a name="monitoring-example-log-file-entries"></a>

追蹤是一種組態，能讓事件以日誌檔案的形式交付到您指定的 Amazon S3 儲存貯體。CloudTrail 日誌檔案包含一或多個日誌專案。一個事件為任何來源提出的單一請求，並包含請求動作、請求的日期和時間、請求參數等資訊。CloudTrail 日誌檔案並非依公有 API 呼叫追蹤記錄的堆疊排序，因此不會以任何特定順序出現。

以下範例顯示的 CloudTrail 日誌項目會示範 `CreateContainer` 操作：

```
{
    "eventVersion": "1.05",
    "userIdentity": {
        "type": "IAMUser",
        "principalId": "ABCDEFGHIJKL123456789",
        "arn": "arn:aws:iam::111122223333:user/testUser",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "userName": "testUser",
        "sessionContext": {
            "attributes": {
                "mfaAuthenticated": "false",
                "creationDate": "2018-07-09T12:55:42Z"
            }
        },
        "invokedBy": "signin.amazonaws.com"
    },
    "eventTime": "2018-07-09T12:56:54Z",
    "eventSource": "mediastore.amazonaws.com",
    "eventName": "CreateContainer",
    "awsRegion": "ap-northeast-1",
    "sourceIPAddress": "54.239.119.16",
    "userAgent": "signin.amazonaws.com",
    "requestParameters": {
        "containerName": "TestContainer"
    },
    "responseElements": {
        "container": {
            "status": "CREATING",
            "creationTime": "Jul 9, 2018 12:56:54 PM",
            "name": " TestContainer ",
            "aRN": "arn:aws:mediastore:ap-northeast-1:111122223333:container/TestContainer"
        }
    },
    "requestID": "MNCTGH4HRQJ27GRMBVDPIVHEP4LO2BN6MUVHBCPSHOAWNSOKSXCO24B2UEOBBND5DONRXTMFK3TOJ4G7AHWMESI",
    "eventID": "7085b140-fb2c-409b-a329-f567912d704c",
    "eventType": "AwsApiCall",
    "recipientAccountId": "111122223333"
}
```