steampipe plugin install aws

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,
size
from
aws_s3_object_version
where
bucket_name = 'testbucket';
select
bucket_name,
key,
storage_class,
version_id,
is_latest,
size
from
aws_s3_object_version
where
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_id
from
aws_s3_object_version
where
bucket_name = 'testbucket'
and key = 'test/template.txt';
select
bucket_name,
key,
storage_class,
version_id,
is_latest,
size,
etag,
owner_id
from
aws_s3_object_version
where
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_type
from
aws_s3_object_version as v,
aws_s3_object as o
where
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_type
from
aws_s3_object_version as v
join aws_s3_object as o on v.bucket_name = o.bucket_name
where
v.bucket_name = 'test-delete90'
and o.bucket_name = 'test-delete90'
and v.version_id = o.version_id;

Schema for aws_s3_object_version

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
bucket_nametext=The name of the container bucket of this object.
checksum_algorithmjsonbThe algorithm that was used to create a checksum of the object.
etagtextVersion ID of an object.
is_latestbooleanSpecifies whether the object is (true) or is not (false) the latest version of an object.
keytext=The object key.
last_modifiedtimestamp with time zoneDate and time the object was last modified.
owner_display_nametextContainer for the display name of the owner.
owner_idtextThe entity tag is an MD5 hash of that version of the object.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the object is located.
sizebigintSize in bytes of the object.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
storage_classtextThe class of storage used to store the object.
titletextTitle of the resource.
version_idtextThe 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