本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
更新 Amazon S3 Storage Lens 儀表板
Amazon S3 Storage Lens 預設儀表板為 default-account-dashboard
。此儀表板是由 Amazon S3 預先設定,可協助您在主控台上以視覺化方式呈現整個帳戶彙總的免費和進階指標的摘要洞見和趨勢。您無法修改預設儀表板的組態範圍,但您可以將指標選項從免費指標升級為付費進階指標和建議、設定選用指標匯出,甚至停用預設儀表板。預設儀表板無法刪除,且只能停用。如需詳細資訊,請參閱使用 S3 主控台。
使用下列步驟在 Amazon S3 主控台上更新 Amazon S3 Storage Lens 儀表板。
步驟 1:更新儀表板範圍
登入 AWS Management Console ,並在 https://https://console.aws.amazon.com/s3/
開啟 Amazon S3 主控台。 -
在左導覽窗格中,選擇 Storage Lens, Dashboards (Storage Lens、儀表板)。
-
選擇您要編輯的儀表板,然後選擇 Edit (編輯)。
Edit dashboard (編輯儀表板) 頁面即會開啟。
注意
您無法變更下列項目:
-
儀表板名稱
-
主要區域
-
預設儀表板的儀表板範圍,其範圍限定在整個帳戶的儲存體
-
-
(選用) 在儀表板組態頁面的 General (一般) 區段中,請更新標籤並將其新增至儀表板。
您可以使用標籤來管理儀表板的許可,並追蹤 S3 Storage Lens 的成本。如需詳細資訊,請參閱《IAM 使用者指南》中的使用資源標籤控制存取權,以及《AWS Billing 使用者指南》中的 AWS產生的成本分配標籤。
注意
您最多可為儀表板組態中新增 50 個標籤。
-
在 Dashboard scope (儀表板範圍) 區段中,執行以下動作:
-
更新您希望 S3 Storage Lens 在儀表板中包含或排除的區域和儲存貯體。
注意
-
您可以包含或排除區域和儲存貯體。在組織中跨成員帳戶建立組織層級儀表板時,此選項會僅限於「區域」。
-
您最多可以選擇 50 個要包含或排除的儲存貯體。
-
-
更新您希望 S3 Storage Lens 包含或排除的選定區域儲存貯體。您可以包含或排除儲存貯體,但不能同時包含和排除。建立組織層級儀表板時,不會出現此選項。
-
步驟 2:更新指標選擇
-
在 Metrics selection (指標選取) 區段中,選取您要為此儀表板彙總的指標類型。
-
若要包含儲存貯體層級彙總的免費指標,且其可供查詢使用 14 天,請選擇 Free Metrics (免費指標)。
-
若要啟用進階指標和其他進階選項,請選擇 Advanced metrics and recommendations (進階指標和建議)。這些選項包括進階字首彙總、Amazon CloudWatch 發佈和內容相關建議。資料有 15 個月的時間可用於查詢。進階指標和建議會有額外的費用。如需詳細資訊,請參閱 Amazon S3 定價
。 如需進階指標和免費指標的詳細資訊,請參閱 指標選擇。
-
-
在 Advanced metrics and recommendations features (進階指標和建議功能) 下,選取您想要啟用的選項:
-
Advanced metrics (進階指標)
-
CloudWatch 發佈
-
字首彙總
重要
如果為您的 S3 Storage Lens 組態啟用字首彙總,則字首層級指標將不會發佈至 CloudWatch。僅儲存貯體、帳戶和組織層級 S3 Storage Lens 指標發佈至 CloudWatch。
-
-
如果您已啟用 Advanced metrics (進階指標),請選取要在 S3 Storage Lens 儀表板中顯示的 Advanced metrics categories (進階指標類別):
-
活動指標
-
Detailed status code metrics (詳細的狀態碼指標)
-
Advanced cost optimization metrics (進階成本最佳化指標)
-
Advanced data protection metrics (進階資料保護指標)
如需指標類別的詳細資訊,請參閱 指標類別。如需指標的完整清單,請參閱Amazon S3 Storage Lens 指標詞彙表。
-
-
如果您選擇啟用字首彙總,請設定下列項目:
-
請為此儀表板選擇最小字首閥值大小。
例如,字首閾值 5% 表示組成儲存貯體總儲存體大小 5% 或更大的字首將會彙總。
-
選擇字首深度。
此設定表示可評估字首的最多層級數目。字首深度必須小於 10。
-
輸入字首分隔符號字元。
這是用來識別每個字首層級的值。Amazon S3 中的預設值是
/
字元,但您的儲存結構可能會使用其他分隔符號字元。
-
(選用) 步驟 3:儀表板的匯出指標
-
在 Metrics export (指標匯出) 區段中,若要建立每日將放置在您選擇的目的地儲存貯體中的指標匯出,請選擇 Enable (啟用)。若要停用指標匯出,請選擇 Disable (停用)。
指標匯出採用 CSV 或 Apache Parquet 格式。它代表與 S3 Storage Lens 儀表板資料相同的資料範圍,而不提供建議。
-
若已啟用,請選擇每日指標匯出的輸出格式:CSV 或 Apache Parquet。
Parquet 是 Hadoop 的開放原始碼檔案格式,以平面直欄式格式儲存巢狀資料。
-
選擇指標匯出的目的地 S3 儲存貯體。
您可以在 S3 Storage Lens 儀表板的目前帳戶中選擇一個儲存貯體。或者, AWS 帳戶 如果您有目的地儲存貯體許可和目的地儲存貯體擁有者的帳戶 ID,您可以選擇另一個儲存貯體。
-
選擇目的地 S3 儲存貯體 (格式:
s3://
)。bucket-name
/prefix
儲存貯體必須位於 S3 Storage Lens 儀表板的主要區域中。S3 主控台會顯示將由 Amazon S3 新增至目的地儲存貯體政策的 Destination bucket permission (目的地儲存貯體許可)。Amazon S3 會更新目的地儲存貯體上的儲存貯體政策,以允許 S3 將資料置於該儲存貯體中。
-
(選用) 若要啟用伺服器端加密進行指標匯出,請選擇 Specify an encryption key (指定加密金鑰)。然後,選擇加密類型:Amazon S3 受管金鑰 (SSE-S3) 或 AWS Key Management Service 金鑰 (SSE-KMS)。
您可以在 Amazon S3 受管金鑰 (SSE-S3) 和 AWS Key Management Service (AWS KMS) 金鑰 (SSE-KMS) 之間進行選擇。
-
(選用) 若要指定 AWS KMS 金鑰,您必須選擇 KMS 金鑰或輸入金鑰 Amazon Resource Name (ARN)。在 AWS KMS 金鑰下,使用下列其中一種方式指定 KMS 金鑰:
-
若要從可用的 KMS 金鑰清單中選擇,請選擇從 AWS KMS keys中選擇,然後從可用金鑰清單中選擇您的 KMS 金鑰。
AWS 受管金鑰 (
aws/s3
) 和您的客戶受管金鑰都會顯示在此清單中。如需詳細了解客戶受管金鑰,請參閱《AWS Key Management Service 開發人員指南》中的客戶金鑰和 AWS 金鑰。注意
S3 Storage Lens 的 S3-KMS 加密不支援 AWS 受管金鑰 (
aws/S3
)。 -
若要輸入 KMS 金鑰 ARN,請選擇輸入 AWS KMS key ARN,然後在出現的欄位中輸入您的 KMS 金鑰 ARN。
-
若要在 AWS KMS 主控台中建立新的客戶受管金鑰,請選擇建立 KMS 金鑰。
如果您選擇客戶受管金鑰,您必須授予 S3 Storage Lens 許可,才能在 AWS KMS 金鑰政策中加密。如需詳細資訊,請參閱使用 AWS KMS key 加密指標匯出。
如需建立 的詳細資訊 AWS KMS key,請參閱《 AWS Key Management Service 開發人員指南》中的建立金鑰。
-
-
選擇儲存變更。
若要進一步了解您的儲存,您可以建立一或多個 S3 Storage Lens 群組,並將其連接至儀表板。S3 Storage Lens 群組是根據字首、尾碼、物件標籤、物件大小、物件存留期為物件定義的自訂篩選條件,或這些篩選條件的組合。
您可以使用 S3 Storage Lens 群組取得對大型共用儲存貯體 (例如資料湖) 的精細可見度,以做出更明智的商業決策。例如,您可以將儲存用量劃分為個別專案的特定物件群組以及單一或多個儲存貯體內的成本中心,以簡化儲存配置並最佳化成本報告。
若要使用 S3 Storage Lens 群組,您必須升級儀表板以使用進階指標和建議。如需關於 S3 Storage Lens 群組的詳細資訊,請參閱 使用 S3 Storage Lens 群組來篩選和彙總指標。
下列範例命令會更新 Amazon S3 Storage Lens 儀表板組態。若要使用這些範例,請以您自己的資訊取代
。user input placeholders
aws s3control put-storage-lens-configuration --account-id=
111122223333
--config-id=example-dashboard-configuration-id
--region=us-east-1
--storage-lens-configuration=file://./config.json
--tags=file://./tags.json
範例 – 使用進階指標和建議來更新 Amazon S3 Storage Lens 組態
下列範例示範如何在適用於 Java 的 SDK 中使用進階指標和建議來更新預設 S3 Storage Lens 組態:
package aws.example.s3control; import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.s3control.AWSS3Control; import com.amazonaws.services.s3control.AWSS3ControlClient; import com.amazonaws.services.s3control.model.AccountLevel; import com.amazonaws.services.s3control.model.ActivityMetrics; import com.amazonaws.services.s3control.model.BucketLevel; import com.amazonaws.services.s3control.model.Format; import com.amazonaws.services.s3control.model.Include; import com.amazonaws.services.s3control.model.OutputSchemaVersion; import com.amazonaws.services.s3control.model.PrefixLevel; import com.amazonaws.services.s3control.model.PrefixLevelStorageMetrics; import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest; import com.amazonaws.services.s3control.model.S3BucketDestination; import com.amazonaws.services.s3control.model.SSES3; import com.amazonaws.services.s3control.model.SelectionCriteria; import com.amazonaws.services.s3control.model.StorageLensAwsOrg; import com.amazonaws.services.s3control.model.StorageLensConfiguration; import com.amazonaws.services.s3control.model.StorageLensDataExport; import com.amazonaws.services.s3control.model.StorageLensDataExportEncryption; import com.amazonaws.services.s3control.model.StorageLensTag; import java.util.Arrays; import java.util.List; import static com.amazonaws.regions.Regions.
US_WEST_2
; public class UpdateDefaultConfigWithPaidFeatures { public static void main(String[] args) { String configurationId = "default-account-dashboard"; // This configuration ID cannot be modified. String sourceAccountId = "111122223333
"; try { SelectionCriteria selectionCriteria = new SelectionCriteria() .withDelimiter("/"
) .withMaxDepth(5
) .withMinStorageBytesPercentage(10.0
); PrefixLevelStorageMetrics prefixStorageMetrics = new PrefixLevelStorageMetrics() .withIsEnabled(true) .withSelectionCriteria(selectionCriteria); BucketLevel bucketLevel = new BucketLevel() .withActivityMetrics(new ActivityMetrics().withIsEnabled(true
)) .withPrefixLevel(new PrefixLevel().withStorageMetrics(prefixStorageMetrics)); AccountLevel accountLevel = new AccountLevel() .withActivityMetrics(new ActivityMetrics().withIsEnabled(true)) .withBucketLevel(bucketLevel); StorageLensConfiguration configuration = new StorageLensConfiguration() .withId(configurationId) .withAccountLevel(accountLevel) .withIsEnabled(true); AWSS3Control s3ControlClient = AWSS3ControlClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(US_WEST_2
) .build(); s3ControlClient.putStorageLensConfiguration(new PutStorageLensConfigurationRequest() .withAccountId(sourceAccountId) .withConfigId(configurationId) .withStorageLensConfiguration(configuration) ); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon S3 couldn't process // it and returned an error response. e.printStackTrace(); } catch (SdkClientException e) { // Amazon S3 couldn't be contacted for a response, or the client // couldn't parse the response from Amazon S3. e.printStackTrace(); } } }
注意
進階指標和建議需支付額外費用。如需詳細資訊,請參閱進階指標和建議。