使用 建立報告計劃 AWS Backup API - AWS Backup

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

使用 建立報告計劃 AWS Backup API

您也可以透過程式設計方式使用報告計畫。

報告有兩種類型。一種類型是任務報告,顯示過去 24 小時內完成的任務和所有作用中的任務。第二種報告類型是合規報告。合規報告可以監視資源層級或生效的其他控制項。建立報告時,請選擇要建立的報告類型。

備份計畫相似,您建立的報告計畫會自動建立報告並定義其目的地 Amazon S3 儲存貯體。報告計畫要求您必須擁有 S3 儲存貯體,以便接收報告。如需設定新 S3 儲存貯體的指示,請參閱《Amazon Simple Storage Service 使用者指南》中的<步驟 1:建立您的第一個 S3 儲存貯體>

如果您使用自訂KMS金鑰加密儲存貯體,KMS金鑰政策必須符合下列要求:

  • Action 屬性必須至少包含 kms:GenerateDataKeykms:Decrypt

政策AWSServiceRolePolicyForBackupReports具有這些許可。

單一帳戶、單一區域報表請使用下列語法呼叫 CreateReportPlan

{ "ReportPlanName": "string", "ReportPlanDescription": "string", "ReportSetting": { "ReportTemplate": enum, // Can be RESOURCE_COMPLIANCE_REPORT, CONTROL_COMPLIANCE_REPORT, BACKUP_JOB_REPORT, COPY_JOB_REPORT, or RESTORE_JOB_REPORT. Only include "ReportCoverageList" if your report is a COMPLIANCE_REPORT. "ReportDeliveryChannel": { "S3BucketName": "string", "S3KeyPrefix": "string", "Formats": [ enum ] // Optional. Can be either CSV, JSON, or both. Default is CSV if left blank. }, "ReportPlanTags": { "string" : "string" // Optional. }, "IdempotencyToken": "string" }

當您DescribeReportPlan使用報告計劃的唯一名稱呼叫 時, AWS Backup 會以下列資訊API回應。

{ "ReportPlanArn": "string", "ReportPlanName": "string", "ReportPlanDescription": "string", "ReportSetting": { "ReportTemplate": enum, }, "ReportDeliveryChannel": { "S3BucketName": "string", "S3KeyPrefix": "string", "Formats": [ enum ] }, "DeploymentStatus": enum "CreationTime": timestamp, "LastAttemptExecutionTime": timestamp, "LastSuccessfulExecutionTime": timestamp }

多帳戶、多區域報表請使用下列語法呼叫 CreateReportPlan

{ "IdempotencyToken": "string", "ReportDeliveryChannel": { "Formats": [ "string" ], *//Organization report only support CSV file* "S3BucketName": "string", "S3KeyPrefix": "string" }, "ReportPlanDescription": "string", "ReportPlanName": "string", "ReportPlanTags": { "string" : "string" }, "ReportSetting": { "Accounts": [ "string" ], // Use string value of "ROOT" to include all organizational units "OrganizationUnits": [ "string" ], "Regions": ["string"], // Use wildcard value in string to include all Regions "FrameworkArns": [ "string" ], "NumberOfFrameworks": number, "ReportTemplate": "string" } }

當您DescribeReportPlan使用報告計劃的唯一名稱呼叫 時, AWS Backup 會以多帳戶、多區域計劃的資訊API回應:

{ "ReportPlan": { "CreationTime": number, "DeploymentStatus": "string", "LastAttemptedExecutionTime": number, "LastSuccessfulExecutionTime": number, "ReportDeliveryChannel": { "Formats": [ "string" ], "S3BucketName": "string", "S3KeyPrefix": "string" }, "ReportPlanArn": "string", "ReportPlanDescription": "string", "ReportPlanName": "string", "ReportSetting": { "Accounts":[ "string" ], "OrganizationUnits":[ "string" ], "Regions": [ "string" ], "FrameworkArns": [ "string" ], "NumberOfFrameworks": number, "ReportTemplate": "string" } } }