How to configure and manage a bucket inventory in Object Storage
Create a bucket inventory configuration to get scheduled reports on the contents of a bucket. You can create up to five configurations for the same bucket and temporarily disable report generation without deleting the configuration when needed.
To create, modify or delete inventory configurations, make sure that you have at least the storage.editorrole for the bucket, its parent project or tenant.
To use another bucket as the destination for reports, make sure that you have at least the storage.uploader role for the destination bucket, its parent project or tenant.
To view inventory configurations, make sure that you have at least the storage.viewer role for the bucket, its parent project or tenant.
To create, modify or delete inventory configurations, make sure that you have at least the storage.editorrole for the bucket, its parent project or tenant.
To use another bucket as the destination for reports, make sure that you have at least the storage.uploader role for the destination bucket, its parent project or tenant.
To view inventory configurations, make sure that you have at least the storage.viewer role for the bucket, its parent project or tenant.
To create, modify or delete inventory configurations, make sure that you have at least the storage.editorrole for the bucket, its parent project or tenant.
To use another bucket as the destination for reports, make sure that you have at least the storage.uploader role for the destination bucket, its parent project or tenant.
To view inventory configurations, make sure that you have at least the storage.viewer role for the bucket, its parent project or tenant.
Open the page of the bucket where you want to create an inventory configuration.
Click Add → Inventory configuration.
Set the inventory configuration parameters:
Name: Name of the configuration. Object Storage uses it both in the list of configurations and in the keys of report objects.
(Optional) Source prefix: Prefix that filters source objects included in the report. The report only contains objects whose keys start with this prefix.
Project: Project that contains the bucket where Object Storage delivers the reports.
Bucket: Bucket where Object Storage delivers the reports. You can select the current bucket or a different one in the same region.
(Optional) Destination prefix: Prefix that Object Storage adds to the keys of report objects. For example, test_dir/. Use it to keep reports separate from other objects in the destination bucket.
Output format: Format and compression of report objects:
CSV compressed with GZIP
Apache Parquet compressed with Snappy
Object versions: Whether a report lists only the current version of every object (Current version only) or all its versions (Include all versions).
Optional metadata fields to export: Additional object metadata that Object Storage can include in a report. For more information, see What a report contains.
Click Create.
The configuration will appear on the Inventory configuration tab of the bucket and become active.
Get the ID of the bucket where you want to create an inventory configuration:
--parent-id: ID of the bucket where you create the inventory configuration.
--destination-bucket-id: ID of the bucket where Object Storage delivers reports. The bucket must be in the same region as the source bucket.
--destination-prefix (optional): Prefix that Object Storage adds to the keys of report objects.
--source-prefix (optional): Prefix that filters source objects included in the report.
--schedule: How often Object Storage generates a report: daily or weekly.
--output-format: Format and compression of report objects: csv_gzip or parquet_snappy.
--enabled: Enables report generation for the inventory configuration. Set it to true when you create a configuration that should start generating reports.
--noncurrent-versions (optional): Includes noncurrent object versions in the report. Set it to true if you want the report to include all object versions. The bucket must have versioning enabled.
--optional-fields (optional): Additional object metadata fields to include in the report. The example exports the last access time and checksum algorithms.
Add an inventory configuration to your Terraform configuration:
The configuration contains the following arguments:
parent_id: ID of the bucket where you create the inventory configuration.
destination_bucket_id: ID of the bucket where Object Storage delivers reports. The bucket must be in the same region as the source bucket.
destination_prefix (optional): Prefix that Object Storage adds to the keys of report objects.
source_prefix (optional): Prefix that filters source objects included in the report.
schedule: How often Object Storage generates a report: DAILY or WEEKLY.
output_format: Format and compression of report objects: CSV_GZIP or PARQUET_SNAPPY.
enabled: Enables report generation for the inventory configuration. Set it to true when you create a configuration that should start generating reports.
noncurrent_versions (optional): Includes noncurrent object versions in the report. Set it to true if you want the report to include all object versions. The bucket must have versioning enabled.
optional_fields (optional): Additional object metadata fields to include in the report. The example exports the last access time and checksum algorithms.
Check that the configuration is correct:
terraform validate
Apply the changes:
terraform apply
To report on all object versions, enable versioning in the bucket where you want to create an inventory configuration. Otherwise, the report will only list current versions.
With Terraform, you can retrieve a specific inventory configuration by name or ID. The following example shows how to retrieve it by name.
Add a data source for the inventory configuration:
data "nebius_storage_v1_inventory" "inventory" { parent_id = "<source_bucket_ID>" name = "<configuration_name>"}output "inventory_configuration" { value = data.nebius_storage_v1_inventory.inventory}
Object Storage delivers reports as regular objects, so you work with them as with any other objects in a bucket. Reports are always compressed.
A complete report can consist of multiple objects. To get the complete report, download every object listed in the files array of the manifest.json file.
Web console
AWS CLI
In the sidebar, go to Storage → Object Storage.
Open the page of the destination bucket that you set in the configuration.
Find the report objects you need. Object Storage stores them under the <destination_prefix>/<bucket_name>/<configuration_name>/data/ prefix, where <bucket_name> is the bucket that you analyze. For more information, see Where Object Storage delivers reports.