Create an Amazon S3 Storage Lens for Tables dashboard
To turn on Amazon S3 Storage Lens for Tables, you create a configuration. The configuration controls what Amazon S3 collects, which table buckets it covers, and where it delivers your metrics. You can create a configuration by using the Amazon S3 console, the AWS CLI, or the API. Before you begin, make sure that you have the permissions described in Setting Amazon S3 Storage Lens for Tables permissions.
Use the following steps to create an Amazon S3 Storage Lens for Tables dashboard on the Amazon S3 console.
Step 1: Configure general settings
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the navigation bar, choose the name of the currently displayed AWS Region. Next, choose the Region that you want to switch to.
-
In the left navigation pane, choose Storage Lens, and then choose the Table buckets tab.
-
Choose Create S3 Tables dashboard.
-
In the General step, do the following:
-
View the Home Region for your dashboard. The home Region is the AWS Region where the configuration and metrics for this Storage Lens dashboard are stored.
-
For Dashboard name, enter a name for your dashboard.
The dashboard name must be fewer than 65 characters and must not contain special characters or spaces.
NoteYou can't change the dashboard name after the dashboard is created.
-
For Status, choose Enabled. When the dashboard is enabled, it displays updated daily metrics.
-
Under Tags - optional, add tags to your dashboard. You can use tags to manage permissions for your dashboard and track storage costs for S3 Storage Lens. For more information, see Controlling access to AWS resources using tags in the IAM User Guide.
NoteYou can add up to 50 tags to your dashboard configuration.
-
-
Choose Next to save your changes and proceed.
Step 2: Define the dashboard scope
-
In the Dashboard scope step, specify the accounts, Regions, and table buckets to include in the scope of the dashboard.
-
Choose the table buckets in your selected Regions that you want S3 Storage Lens to include or exclude. Choose either Include all table buckets or Exclude table buckets. You can either include or exclude table buckets, but not both.
NoteIf you choose Include all table buckets, the dashboard also includes AWS managed table buckets that AWS services create on your behalf.
NoteTo create an organization-level dashboard, you must first enable trusted access for S3 Storage Lens in AWS Organizations. If trusted access isn't enabled, the console prompts you to configure your AWS Organizations settings.
-
Choose Next to save your changes and proceed.
Step 3: Choose your Storage Lens tier
-
In the Storage Lens tier step, choose the tier of features that you want to aggregate for this dashboard:
-
To include free tier metrics, choose Free tier.
-
To add advanced metrics, choose Advanced tier. The advanced tier has an additional cost. For more information, see Amazon S3 pricing
.
-
-
If you chose Advanced tier, select the advanced metric categories that you want to enable:
-
Storage metrics
-
Activity metrics
-
Maintenance metrics
-
-
Choose Next to save your changes and proceed.
Step 4: Choose your metrics export and publishing settings
-
In the Metrics export and publishing step, if you chose the advanced tier, choose CloudWatch publishing to access your Storage Lens metrics in Amazon CloudWatch.
-
To export your Storage Lens dashboard data daily, turn on the daily data export, and then choose the destination bucket type:
-
General purpose bucket – Update the General purpose bucket destination settings.
-
Table bucket – Update the Table bucket destination settings.
-
-
Choose Next to save your changes and proceed.
Step 5: Review your dashboard configuration and create your dashboard
-
On the Review and create step, review your settings. To make changes to a section, choose Edit for that section.
-
After you review and confirm your dashboard configuration settings, choose Submit to create your dashboard.
After you successfully create your dashboard, you can view it in the list of dashboards on the Table buckets tab.
You create a configuration by using the put-storage-lens-configuration
command, which calls the PutStorageLensConfiguration operation. This operation
creates a configuration or replaces an existing one that has the same identifier. You
provide the configuration body as a JSON file through the
--storage-lens-configuration flag. For a sample configuration body and the
fields it supports, see Helper files for using Amazon S3 Storage Lens for Tables.
Example
The following example command creates an Amazon S3 Storage Lens for Tables configuration.
To use this example, replace the with your own information.user input
placeholders
aws s3tables put-storage-lens-configuration --storage-lens-id=your-configuration-id--storage-lens-configuration=file://./config.json
The following example creates a representative Amazon S3 Storage Lens for Tables configuration
in SDK for Java: it scopes the dashboard to specific AWS Regions and table buckets, enables the
advanced tier metric categories, publishes metrics to CloudWatch, and exports metrics to
AWS managed S3 Tables. To use this example, replace the with your own information.user input
placeholders
Example– Create 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.S3TablesException; public class CreateStorageLensConfiguration { 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) // Scope: include specific Regions and table buckets. Omit include to cover all. .include(scope -> scope .regions("us-east-1") .tableBuckets("arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-bucket")) // Advanced tier: add the storage, activity, and maintenance metric categories. .advancedMetricsCategoriesWithStrings("StorageMetrics", "ActivityMetrics", "MaintenanceMetrics") .dataExport(export -> export // Publish metrics to CloudWatch (advanced tier). .cloudWatchMetrics(cw -> cw.isEnabled(true)) // Export metrics to AWS managed S3 Tables. .storageLensTableDestination(dest -> dest.isEnabled(true))) .build(); s3TablesClient.putStorageLensConfiguration(PutStorageLensConfigurationRequest.builder() .storageLensId(storageLensId) .storageLensConfiguration(configuration) .build()); } catch (S3TablesException e) { System.err.println(e.awsErrorDetails().errorMessage()); } } }