

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

# 在 AWS Billing Conductor 中記錄和監控
<a name="billing-security-logging"></a>

監控是維護 AWS 帳戶的可靠性、可用性和效能的重要部分。有數種工具可用來監控您的 AWS Billing Conductor 用量。

## AWS 成本和用量報告
<a name="eb-security-logging-cur"></a>

AWS 成本和用量報告會追蹤您的 AWS 用量，並提供與您的帳戶相關聯的預估費用。每個報告都包含您在 AWS 帳戶中使用的每個 AWS 產品、用量類型和操作唯一組合的明細項目。您可以自訂 AWS 成本和用量報告，以按小時或日期彙總資訊。

如需 AWS 成本和用量報告的詳細資訊，請參閱 [https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html](https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html)。

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

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

若要進一步了解 CloudTrail，請參閱[「AWS CloudTrail 使用者指南」](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)。

## AWS Billing Conductor CloudTrail 事件
<a name="billing-cloudtrail-events"></a>

本節顯示與 Billing and Cost Management 相關之 CloudTrail 事件的完整清單。


****  

| 事件名稱 | 定義 | 
| --- | --- | 
|  `AssociateAccounts`  |  記錄帳戶與帳單群組的關聯。  | 
|  `AssociatePricingRules`  | 記錄定價規則與定價計劃的關聯。 | 
|  `AutoAssociateAccount`  | 記錄帳戶與帳單群組的自動關聯。 | 
|  `AutoDisassociateAccount`  | 在下一個帳單期間，記錄帳戶與帳單群組的自動取消關聯。 | 
|  `BatchAssociateResourcesToCustomLineItem`  | 記錄資源與百分比自訂明細項目的批次關聯。 | 
|  `BatchDisassociateResourcesFromCustomLineItem`  |  記錄資源與百分比自訂明細項目的批次取消關聯。  | 
|  `CreateBillingGroup`  | 記錄帳單群組的建立。 | 
|  `CreateCustomLineItem`  |  記錄自訂明細項目的建立。  | 
|  `CreatePricingPlan`  | 記錄定價計劃的建立。 | 
|  `CreatePricingRule`  | 記錄定價規則的建立。 | 
|  `DeleteBillingGroup`  | 記錄帳單群組的刪除。 | 
|  `DeleteCustomLineItem`  | 記錄刪除自訂明細項目。 | 
|  `DeletePricingPlan`  | 記錄刪除定價計劃。 | 
|  `DeletePricingRule`  | 記錄刪除定價規則。 | 
|  `DisassociateAccounts`  | 記錄帳戶與帳單群組的取消關聯。 | 
|  `DisassociatePricingRules`  | 記錄定價規則與定價計劃的取消關聯。 | 
|  `ListAccountAssociations`  | 記錄對帳單群組中帳戶 ID 的存取。 | 
|  `ListBillingGroupCostReports`  | 記錄帳單群組實際 AWS 費用的存取權。 | 
|  `ListBillingGroups`  | 記錄帳單期間對帳單群組的存取。 | 
|  `ListCustomLineItems`  | 記錄對計費期間內自訂明細項目的存取。 | 
|  `ListCustomLineItemVersions`  | 記錄自訂明細項目版本的存取權。 | 
|  `ListPricingPlans`  | 記錄計費期間對定價計劃的存取。 | 
|  `ListPricingPlansAssociatedWithPricingRule`  | 記錄與定價規則相關聯的定價計劃的存取權。 | 
|  `ListPricingRules`  |  記錄計費期間對定價規則的存取。  | 
|  `ListPricingRulesAssociatedToPricingPlan`  |  記錄與定價計劃相關聯的定價規則存取權。  | 
|  `ListResourcesAssociatedToCustomLineItem`  | 記錄與自訂明細項目相關聯之資源的存取權。 | 
| `ListTagsForResource` |  記錄對資源上標籤的存取。  | 
|  `TagResource`  | 記錄資源上標籤的關聯。 | 
|  `UpdateBillingGroup`  | 記錄帳單群組的更新。 | 
|  `UpdateCustomLineItem`  | 記錄自訂明細項目的更新。 | 
|  `UpdatePricingPlan`  | 記錄定價計劃的更新。 | 
|  `UpdatePricingRule`  | 記錄定價規則的更新。 | 

## AWS CloudTrail 中的帳單執行器資訊
<a name="service-name-info-in-cloudtrail"></a>

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

如需持續記錄 中的事件 AWS 帳戶，包括 AWS Billing Conductor 的事件，請建立追蹤。*線索*能讓 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 的 Amazon SNS 通知](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.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)

CloudTrail 會記錄所有 AWS Billing Conductor 動作，並記錄在 [AWS Billing Conductor API 參考](https://docs.aws.amazon.com/billingconductor/latest/APIReference)中。

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

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

## 了解 AWS Billing Conductor 日誌檔案項目
<a name="understanding-service-name-entries"></a>

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

**Topics**
+ [AutoAssociateAccount](#CT-example-auto)
+ [CreateBillingGroup](#CT-example-create)

### AutoAssociateAccount
<a name="CT-example-auto"></a>

以下範例顯示的是展示 `AutoAssociateAccount` 動作的 CloudTrail 日誌項目。

```
{
    "eventVersion": "1.09",
    "userIdentity": {
        "accountId": "111122223333",
        "invokedBy": "billingconductor.amazonaws.com"
    },
    "eventTime": "2024-02-23T00:22:08Z",
    "eventSource": "billingconductor.amazonaws.com",
    "eventName": "AutoAssociateAccount",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "billingconductor.amazonaws.com",
    "userAgent": "billingconductor.amazonaws.com",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "1v14d239-fe63-4d2b-b3cd-450905b6c33",
    "eventID": "14536982-geff-4fe8-bh18-f18jde35218d0",
    "readOnly": false,
    "eventType": "AwsServiceEvent",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "serviceEventDetails": {
        "requestParameters": {
            "Arn": "arn:aws:billingconductor::111122223333:billinggroup/444455556666",
            "AccountIds": [
                "333333333333"
            ]
        },
        "responseElements": {
            "Arn": "arn:aws:billingconductor::111122223333:billinggroup/444455556666"
        }
    },
    "eventCategory": "Management"
}
```

### CreateBillingGroup
<a name="CT-example-create"></a>

以下範例顯示的是展示 `CreateBillingGroup` 動作的 CloudTrail 日誌項目。

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "accountId":"111122223333",
        "accessKeyId":"ASIAIOSFODNN7EXAMPLE"
    },
    "eventTime": "2024-01-24T20:30:03Z",
    "eventSource": "billingconductor.amazonaws.com",
    "eventName": "CreateBillingGroup",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "100.100.10.10",
    "userAgent": "aws-internal/3 aws-sdk-java/1.11.465 Linux/4.9.124-0.1.ac.198.73.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.192-b12 java/1.8.0_192",
    "requestParameters": {
        "PrimaryAccountId": "444455556666",
        "ComputationPreference": {
            "PricingPlanArn": "arn:aws:billingconductor::111122223333:pricingplan/TqeITi5Bgh"
        },
        "X-Amzn-Client-Token": "32aafb5s-e5b6-47f5-9795-3a69935e9da4",
        "AccountGrouping": {
            "LinkedAccountIds": [
                "444455556666",
                "111122223333"
            ]
        },
        "Name": "***"
    },
    "responseElements": {
        "Access-Control-Expose-Headers": "x-amzn-RequestId,x-amzn-ErrorType,x-amzn-ErrorMessage,Date",
        "Arn": "arn:aws:billingconductor::111122223333:billinggroup/444455556666"
    },
    "requestID": "fb26ae47-3510-a833-98fe-3dc0f602gb49",
    "eventID": "3ab70d86-c63e-46fd8d-a33s-ce2970441a8",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```