View a markdown version of this page

Enabling CloudWatch publishing for Amazon S3 Storage Lens for Tables - Amazon Simple Storage Service

Enabling CloudWatch publishing for Amazon S3 Storage Lens for Tables

You can enable CloudWatch support for new or existing dashboard configurations by using the S3 console, AWS CLI, and AWS SDKs. The CloudWatch publishing option is available for dashboards that use the advanced tier. For advanced tier pricing, see Amazon S3 pricing. No additional CloudWatch metrics publishing charges apply; however, other CloudWatch charges, such as dashboards, alarms, and API calls, do apply.

To enable the CloudWatch publishing option for Amazon S3 Storage Lens for Tables metrics, see the following topics.

You turn on the CloudWatch publishing option when you create or edit an Amazon S3 Storage Lens for Tables dashboard in the Amazon S3 console. CloudWatch publishing is available only when you choose the advanced tier.

To turn on CloudWatch publishing for a dashboard
  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the left navigation pane, choose Storage Lens, and then choose the Table buckets tab.

  3. Create a dashboard, or choose an existing dashboard and choose Edit.

  4. In the Storage Lens tier step, choose Advanced tier.

  5. In the Metrics export and publishing step, choose CloudWatch publishing.

  6. Proceed through the remaining steps, and then on the Review and create step, choose Submit.

To enable the CloudWatch publishing option, use the put-storage-lens-configuration command with a configuration that sets cloudWatchMetrics to isEnabled: true under dataExport. CloudWatch publishing requires the advanced tier, so your configuration must also include advancedMetricsCategories. The following example enables the CloudWatch publishing option for an Amazon S3 Storage Lens for Tables configuration. To use this example, replace the user input placeholders with your own information.

aws s3tables put-storage-lens-configuration --storage-lens-id=your-configuration-id --storage-lens-configuration=file://./config.json

The following config.json file enables the CloudWatch publishing option. For the full set of configuration fields, see Helper files for using Amazon S3 Storage Lens for Tables.

{ "id": "your-configuration-id", "isEnabled": true, "advancedMetricsCategories": [ "StorageMetrics", "ActivityMetrics", "MaintenanceMetrics" ], "dataExport": { "cloudWatchMetrics": { "isEnabled": true } } }

The following example enables the CloudWatch publishing option for an Amazon S3 Storage Lens for Tables configuration by using the AWS SDK for SDK for Java. CloudWatch publishing requires the advanced tier, so the configuration also sets advanced metrics categories. To use this example, replace the user input placeholders with your own information.

Example– Enable CloudWatch publishing for an Amazon S3 Storage Lens for Tables configuration
import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3tables.S3TablesClient; import software.amazon.awssdk.services.s3tables.model.PutStorageLensConfigurationRequest; import software.amazon.awssdk.services.s3tables.model.StorageLensConfiguration; import software.amazon.awssdk.services.s3tables.model.StorageLensConfigurationItem; import software.amazon.awssdk.services.s3tables.model.StorageLensDataExport; public class EnableCloudWatchPublishing { public static void main(String[] args) { String storageLensId = "your-configuration-id"; try (S3TablesClient s3TablesClient = S3TablesClient.builder() .region(Region.US_EAST_1) .build()) { StorageLensConfiguration configuration = StorageLensConfiguration.builder() .id(storageLensId) .isEnabled(true) .advancedMetricsCategoriesWithStrings("StorageMetrics", "ActivityMetrics", "MaintenanceMetrics") .dataExport(StorageLensDataExport.builder() .cloudWatchMetrics(StorageLensConfigurationItem.builder() .isEnabled(true) .build()) .build()) .build(); s3TablesClient.putStorageLensConfiguration(PutStorageLensConfigurationRequest.builder() .storageLensId(storageLensId) .storageLensConfiguration(configuration) .build()); } } }
Next steps

After you enable the CloudWatch publishing option, you can access your Amazon S3 Storage Lens for Tables metrics in CloudWatch. You also can leverage CloudWatch features to monitor and analyze your data in CloudWatch. For more information, see the following topics: