本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
記錄 AWS Marketplace 計量API呼叫 AWS CloudTrail
AWS Marketplace 與提供使用者 AWS CloudTrail、角色或 AWS 服務 中所採取之動作記錄的服務整合 AWS Marketplace。 CloudTrail 將API呼叫擷取 AWS Marketplace 為事件。擷取的呼叫包括來自 AWS Marketplace 主控台的呼叫和對 AWS Marketplace API作業的程式碼呼叫。
CloudTrail 在您創建帳戶 AWS 帳戶 時啟用。當受支援的事件活動發生在中時 AWS Marketplace,該活動會與事件歷史記錄中的其他 CloudTrail AWS 服務 事件一起記錄在事件中。您可以檢視、搜尋和下載 帳戶的最新事件。
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
要求是使用根憑證還是 AWS Identity and Access Management 使用者認證提出。
-
要求是使用角色或同盟使用者的暫時安全性登入資料來提出。
-
該請求是否由另一項 AWS 服務服務提出。
AWS Marketplace 支持將BatchMeterUsage
操作記錄為 CloudTrail日誌文件中的事件。
AWS Marketplace 計量API記錄檔項目範例
範例:BatchMeterUsage
下列範例顯示示範的BatchMeterUsage
動作的 CloudTrail 記錄項目 AWS Marketplace Metering Service。當賣方傳送計量記錄以報告其客戶對於上列出的軟體即服務 (SaaS) 產品的使用情況時 AWS Marketplace,賣方會記 CloudTrail 錄此記錄項目 AWS 帳戶。
{ "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::
123456789012
:user/Alice
", "accountId": "123456789012
", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2018-04-19T16:32:51Z", "eventSource": "metering-marketplace.amazonaws.com", "eventName": "BatchMeterUsage", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.0.2/24", "userAgent": "Coral/Netty14", "requestParameters": { "usageRecords": [ { "dimension": "Dimension1
", "timestamp": "Apr 19, 2018 4:32:50 PM", "customerIdentifier": "customer1
", "quantity": 1 } ], "productCode": "EXAMPLE_proCode" }, "responseElements": { "results": [ { "usageRecord": { "dimension": "Dimension1
", "timestamp": "Apr 19, 2018 4:32:50 PM", "customerIdentifier": "customer1
", "quantity": 1 }, "meteringRecordId": "bEXAMPLE-98f0-4e90-8bd2-bf0EXAMPLE1e
", "status": "Success" } ], "unprocessedRecords": [ ] }, "requestID": "dEXAMPLE-251d-11e7-8d11-1f3EXAMPLE8b
", "eventID": "cEXAMPLE-e6c2-465d-b47f-150EXAMPLE97
", "readOnly": false, "eventType": "AwsApiCall", "recipientAccountId": "123456789012
" } ] }
例如:RegisterUsage
對於容器
下列範例顯示示範的RegisterUsage
動作的 CloudTrail 記錄項目 AWS Marketplace Metering Service。在買方中部署一小時定價的容器產品時 AWS 帳戶,容器中的軟體會呼叫買方RegisterUsage
內部,以針對該 Amazon 彈性容器服務 (亞馬遜) 任務或 Amazon 彈性 Kubernetes 服務 (AmazonECS) 網繭啟動每小時計量。 AWS Marketplace AWS 帳戶 EKS此 CloudTrail 記錄項目會記錄在買家的中 AWS 帳戶。
{ "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "EX_PRINCIPAL_ID:botocore-session-1111111111", "arn": "arn:aws:sts::123456789012:assumed-role/Alice/botocore-session-1111111111", "accountId": "123456789012", "accessKeyId": "EXAMPLE_KEY_ID", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::123456789012:role/Alice", "accountId": "123456789012", "userName": "Alice" }, "webIdFederationData": { "federatedProvider": "arn:aws:iam::123456789012:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/EXAMPLEFA1C58F08CDB049167EXAMPLE", "attributes": {} }, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-07-23T02:19:34Z" } } }, "eventTime": "2020-07-23T02:19:46Z", "eventSource": "metering-marketplace.amazonaws.com", "eventName": "RegisterUsage", "awsRegion": "us-east-1", "sourceIPAddress": "1.2.3.4", "userAgent": "aws-cli/1.18.103 Python/3.8.2 Linux/4.14.181-142.260.amzn2.x86_64 botocore/1.17.26", "requestParameters": { "productCode": "EXAMPLE_proCode", "publicKeyVersion": 1 }, "responseElements": { "signature": "eyJhbGciOiJQUzI1Ni..." }, "requestID": "dEXAMPLE-251d-11e7-8d11-1f3EXAMPLE8b", "eventID": "cEXAMPLE-e6c2-465d-b47f-150EXAMPLE97", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" }
示例:MeterUsage
對於 Amazon 上的容器 EKS
下列範例顯示了一個 CloudTrail 日誌項目,該記錄項目示範來自 Amazon 上 AWS Marketplace Metering Service 的容器的MeterUsage
動作EKS。當具有自定義計量的容器產品部署在買方中時 AWS 帳戶,容器中的軟件會在買方MeterUsage
內調 AWS 帳戶 用每小時報告。 AWS Marketplace 此 CloudTrail 記錄項目會記錄在買家的中 AWS 帳戶。
{ "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "EX_PRINCIPAL_ID:botocore-session-1111111111", "arn": "arn:aws:sts::123456789012:assumed-role/Alice/botocore-session-1111111111", "accountId": "123456789012", "accessKeyId": "EXAMPLE_KEY_ID", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::123456789012:role/Alice", "accountId": "123456789012", "userName": "Alice" }, "webIdFederationData": { "federatedProvider": "arn:aws:iam::123456789012:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/EXAMPLEFA1C58F08CDB049167EXAMPLE", "attributes": {} }, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-07-23T01:03:26Z" } } }, "eventTime": "2020-07-23T01:38:13Z", "eventSource": "metering-marketplace.amazonaws.com", "eventName": "MeterUsage", "awsRegion": "us-east-1", "sourceIPAddress": "1.2.3.4", "userAgent": "aws-cli/1.18.103 Python/3.8.2 Linux/4.14.181-142.260.amzn2.x86_64 botocore/1.17.26", "requestParameters": { "timestamp": "Jul 23, 2020 1:35:44 AM", "usageQuantity": 1, "usageDimension": "Dimension1", "productCode": "EXAMPLE_proCode" }, "responseElements": { "meteringRecordId": "bEXAMPLE-98f0-4e90-8bd2-bf0EXAMPLE1e" }, "requestID": "dEXAMPLE-251d-11e7-8d11-1f3EXAMPLE8b", "eventID": "cEXAMPLE-e6c2-465d-b47f-150EXAMPLE97", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" }
範例:MeterUsage
開啟 AMIs
下列範例顯示示範 Amazon 機器映像 (AMIs) 中MeterUsage
AWS Marketplace Metering Service 動作的 CloudTrail 日誌項目。當具有自定義計量的AMI產品部署在買方的時候 AWS 帳戶,從買方的AMI電話MeterUsage
中的軟件每小時報告使用情況。 AWS Marketplace AWS 帳戶 此 CloudTrail 記錄項目會記錄在買家的中 AWS 帳戶。
{ "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "EX_PRINCIPAL_ID:i-exampled859aa775c", "arn": "arn:aws:sts::123456789012:assumed-role/Alice/i-exampled859aa775c", "accountId": "123456789012", "accessKeyId": "EXAMPLE_KEY_ID", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::123456789012:role/Alice", "accountId": "123456789012", "userName": "Alice" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-07-10T23:05:20Z" }, "ec2RoleDelivery": "1.0" } }, "eventTime": "2020-07-10T23:06:42Z", "eventSource": "metering-marketplace.amazonaws.com", "eventName": "MeterUsage", "awsRegion": "us-east-1", "sourceIPAddress": "1.2.3.4", "userAgent": "aws-cli/1.16.102 Python/2.7.16 Linux/4.14.133-113.112.amzn2.x86_64 botocore/1.12.92", "requestParameters": { "productCode": "EXAMPLE_proCode", "timestamp": "Jul 10, 2020 11:06:41 PM", "usageDimension": "Dimension1", "usageQuantity": 1, "dryRun": false }, "responseElements": { "meteringRecordId": "bEXAMPLE-98f0-4e90-8bd2-bf0EXAMPLE1e" }, "requestID": "dEXAMPLE-251d-11e7-8d11-1f3EXAMPLE8b", "eventID": "cEXAMPLE-e6c2-465d-b47f-150EXAMPLE97", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" }