Table: aws_s3_object_version - Query AWS S3 Object Versions
The aws_s3_object_version
table in Steampipe allows you to query information about versions of objects stored in Amazon S3 buckets. This includes details such as the bucket name, delimiter, encoding type, version ID marker, prefix, whether the results are truncated, common prefixes, delete markers, and version information.
Table Usage Guide
The aws_s3_object_version
table in Steampipe provides you with information about object versions within AWS Simple Storage Service (S3). This table enables you, as a DevOps engineer, to query object version specific details.
Important Notes
- You must specify a
bucket_name
in a where or join clause in order to use this table. - It's recommended that you specify the
prefix
column when querying buckets with a large number of object versions to reduce the query time.
Examples
Basic Info
Query basic information about AWS S3 object versions, including the bucket name, size, version ID, storage class and last update.
select bucket_name, key, storage_class, version_id, is_latest, sizefrom aws_s3_object_versionwhere bucket_name = 'testbucket';
select bucket_name, key, storage_class, version_id, is_latest, sizefrom aws_s3_object_versionwhere bucket_name = 'testbucket';
List Object Versions for a particular object
Retrieve object versions along with common prefixes and delete markers.
select bucket_name, key, storage_class, version_id, is_latest, size, etag, owner_idfrom aws_s3_object_versionwhere bucket_name = 'testbucket' and key = 'test/template.txt';
select bucket_name, key, storage_class, version_id, is_latest, size, etag, owner_idfrom aws_s3_object_versionwhere bucket_name = 'testbucket' and key = 'test/template.txt';
Get the specific version details of objects
Ensure that you specify the exact version identifier for each object of interest. This process typically involves accessing a version-controlled storage system or database where each object can have multiple versions, each distinguished by a unique version ID.
select v.bucket_name, v.key, v.storage_class, v.version_id, o.accept_ranges, o.body, o.content_typefrom aws_s3_object_version as v, aws_s3_object as owhere v.bucket_name = 'test-delete90' and o.bucket_name = 'test-delete90' and v.version_id = o.version_id;
select v.bucket_name, v.key, v.storage_class, v.version_id, o.accept_ranges, o.body, o.content_typefrom aws_s3_object_version as v join aws_s3_object as o on v.bucket_name = o.bucket_namewhere v.bucket_name = 'test-delete90' and o.bucket_name = 'test-delete90' and v.version_id = o.version_id;
Schema for aws_s3_object_version
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
bucket_name | text | = | The name of the container bucket of this object. |
checksum_algorithm | jsonb | The algorithm that was used to create a checksum of the object. | |
etag | text | Version ID of an object. | |
is_latest | boolean | Specifies whether the object is (true) or is not (false) the latest version of an object. | |
key | text | = | The object key. |
last_modified | timestamp with time zone | Date and time the object was last modified. | |
owner_display_name | text | Container for the display name of the owner. | |
owner_id | text | The entity tag is an MD5 hash of that version of the object. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the object is located. | |
size | bigint | Size in bytes of the object. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
storage_class | text | The class of storage used to store the object. | |
title | text | Title of the resource. | |
version_id | text | The entity tag is an MD5 hash of that version of the object. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_s3_object_version