S3 Storage Lens グループをダッシュボードにアタッチまたは削除する、またはダッシュボードから S3 Storage Lens グループを削除する - Amazon Simple Storage Service

S3 Storage Lens グループをダッシュボードにアタッチまたは削除する、またはダッシュボードから S3 Storage Lens グループを削除する

Amazon S3 ストレージレンズの高度なティアにアップグレードしたら、Storage Lens グループをダッシュボードにアタッチできます。複数の Storage Lens グループがある場合、目的のグループを含めたり除外したりできます。

Storage Lens グループは、ダッシュボードアカウントの指定されたホームリージョン内に存在している必要があります。Storage Lens グループをダッシュボードに接続すると、48 時間以内にメトリクスのエクスポートで追加の Storage Lens グループの集約データを受け取ります。

注記

Storage Lens グループの集約メトリクスを表示するには、そのデータを Storage Lens ダッシュボードにアタッチする必要があります。Storage Lens グループの JSON 設定ファイルの例については、「JSON の Storage Lens グループを使用した S3 Storage Lens の設定例」を参照してください。

Storage Lens グループを Storage Lens ダッシュボードにアタッチするには
  1. AWS Management Console にサインインし、Amazon S3 コンソール https://console.aws.amazon.com/s3/ を開きます。

  2. 左ナビゲーションペインの、[S3 Storage Lens ] で、[ダッシュボード] を選択します。

  3. Storage Lens グループをアタッチする Storage Lens ダッシュボードのオプションボタンを選択します。

  4. [編集] を選択します。

  5. メトリクスの選択[Advanced metrics and recommendations] (アドバンストメトリクスとレコメンデーション) を選択します。

  6. [Storage Lens グループ集約] を選択します。

    注記

    デフォルトでは、[高度なメトリクス] も選択されています。ただし、Storage Lens グループのデータを集約する必要がないため、この設定の選択を解除することもできます。

  7. [Storage Lens グループ集約] までスクロールし、データ集約に含める、または除外する 1 つまたは複数の Storage Lens グループを指定します。次のフィルタリングオプションを設定できます。

    • 特定の Storage Lens グループを含める場合は、[Storage Lens グループを含める] を選択します。[含めるStorage Lens グループ] で、Storage Lens グループを選択します。

    • すべての Storage Lens グループを含める場合は、[ホームリージョンのすべてのStorage Lens グループをこのアカウントに含める] を選択します。

    • 特定の Storage Lens グループを除外する場合は、[Storage Lens グループを除外する] を選択します。[除外する Storage Lens グループ] で、除外する Storage Lens グループを選択します。

  8. [Save changes] (変更の保存) をクリックします。Storage Lens グループを正しく設定していれば、48 時間以内にダッシュボードに追加の Storage Lens グループ集約データが表示されます。

S3 Storage Lens ダッシュボードから Storage Lens グループを削除するには
  1. AWS Management Console にサインインし、Amazon S3 コンソール https://console.aws.amazon.com/s3/ を開きます。

  2. ナビゲーションペインの、[S3 Storage Lens] で、[ダッシュボード] を選択します。

  3. Storage Lens グループを削除する Storage Lens ダッシュボードのオプションボタンを選択します。

  4. [ダッシュボード設定を表示] を選択します。

  5. [編集] を選択します。

  6. [メトリクスの選択] セクションまで下にスクロールします。

  7. [Storage Lens グループ集約] で、削除する Storage Lens グループの横にある [X] を選択します。これにより、Storage Lens グループが削除されます。

    すべての Storage Lens グループをダッシュボードに含めた場合は、[このアカウントにホームリージョンのすべての Storage Lens グループを含める] の横にあるチェックボックスをオフにします。

  8. [Save changes] (変更の保存) をクリックします。

    注記

    ダッシュボードに設定の更新が反映されるまでに最大 48 時間かかることがあります。

例 – すべての ストレージレンズグループをダッシュボードにアタッチする

次の SDK for Java の例では、アカウント 111122223333 のすべての Storage Lens グループを DashboardConfigurationId ダッシュボードにアタッチします。

package aws.example.s3control; import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.services.s3control.AWSS3Control; import com.amazonaws.services.s3control.AWSS3ControlClient; import com.amazonaws.services.s3control.model.BucketLevel; import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.s3control.model.AccountLevel; import com.amazonaws.services.s3control.model.StorageLensConfiguration; import com.amazonaws.services.s3control.model.StorageLensGroupLevel; import static com.amazonaws.regions.Regions.US_WEST_2; public class CreateDashboardWithStorageLensGroups { public static void main(String[] args) { String configurationId = "ExampleDashboardConfigurationId"; String sourceAccountId = "111122223333"; try { StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel(); AccountLevel accountLevel = new AccountLevel() .withBucketLevel(new BucketLevel()) .withStorageLensGroupLevel(storageLensGroupLevel); 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(); } } }
例 – 2 つの ストレージレンズグループをダッシュボードにアタッチする

次の AWS SDK for Java 例では、2 つの Storage Lens グループ (StorageLensGroupName1StorageLensGroupName2) を ExampleDashboardConfigurationId ダッシュボードにアタッチします。

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.BucketLevel; import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest; import com.amazonaws.services.s3control.model.StorageLensConfiguration; import com.amazonaws.services.s3control.model.StorageLensGroupLevel; import com.amazonaws.services.s3control.model.StorageLensGroupLevelSelectionCriteria; import static com.amazonaws.regions.Regions.US_WEST_2; public class CreateDashboardWith2StorageLensGroups { public static void main(String[] args) { String configurationId = "ExampleDashboardConfigurationId"; String storageLensGroupName1 = "StorageLensGroupName1"; String storageLensGroupName2 = "StorageLensGroupName2"; String sourceAccountId = "111122223333"; try { StorageLensGroupLevelSelectionCriteria selectionCriteria = new StorageLensGroupLevelSelectionCriteria() .withInclude( "arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName1, "arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName2); System.out.println(selectionCriteria); StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel() .withSelectionCriteria(selectionCriteria); AccountLevel accountLevel = new AccountLevel() .withBucketLevel(new BucketLevel()) .withStorageLensGroupLevel(storageLensGroupLevel); 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(); } } }
例 – 除外項目を含むすべてのストレージレンズグループをアタッチする

次の SDK for Java 例では、2 つの Storage Lens グループを ExampleDashboardConfigurationId ダッシュボードにアタッチします (指定した StorageLensGroupName1StorageLensGroupName2 を除く):

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.BucketLevel; import com.amazonaws.services.s3control.model.PutStorageLensConfigurationRequest; import com.amazonaws.services.s3control.model.StorageLensConfiguration; import com.amazonaws.services.s3control.model.StorageLensGroupLevel; import com.amazonaws.services.s3control.model.StorageLensGroupLevelSelectionCriteria; import static com.amazonaws.regions.Regions.US_WEST_2; public class CreateDashboardWith2StorageLensGroupsExcluded { public static void main(String[] args) { String configurationId = "ExampleDashboardConfigurationId"; String storageLensGroupName1 = "StorageLensGroupName1"; String storageLensGroupName2 = "StorageLensGroupName2"; String sourceAccountId = "111122223333"; try { StorageLensGroupLevelSelectionCriteria selectionCriteria = new StorageLensGroupLevelSelectionCriteria() .withInclude( "arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName1, "arn:aws:s3:" + US_WEST_2.getName() + ":" + sourceAccountId + ":storage-lens-group/" + storageLensGroupName2); System.out.println(selectionCriteria); StorageLensGroupLevel storageLensGroupLevel = new StorageLensGroupLevel() .withSelectionCriteria(selectionCriteria); AccountLevel accountLevel = new AccountLevel() .withBucketLevel(new BucketLevel()) .withStorageLensGroupLevel(storageLensGroupLevel); 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(); } } }