steampipe plugin install aws

Table: aws_lightsail_bucket - Query AWS Lightsail Buckets using SQL

The AWS Lightsail Bucket is part of the Amazon Lightsail service, offering simple object storage solutions for small to medium-sized workloads. It provides an easy-to-use interface for storing and managing data, ideal for applications that require consistent storage performance, like web hosting or backups.

Table Usage Guide

The aws_lightsail_bucket table in Steampipe provides detailed information about the buckets within AWS Lightsail. This table allows DevOps engineers, cloud architects, and developers to query various bucket-specific details, including configuration settings, access permissions, and associated tags. You can use this table to gather insights on buckets, such as those configured with specific access rules, buckets located in particular regions, or buckets with certain tags. The schema outlines various attributes of the Lightsail bucket for you, including the bucket name, creation timestamp, access rules, and more.

Examples

Basic info

Get an overview of the buckets.

select
name,
arn,
state_code,
created_at
from
aws_lightsail_bucket;
select
name,
arn,
state_code,
created_at
from
aws_lightsail_bucket;

Count of buckets by region

Identify the distribution of your Lightsail buckets across different AWS regions to optimize data storage and retrieval.

select
region,
count(*) as bucket_count
from
aws_lightsail_bucket
group by
region;
select
region,
count(*) as bucket_count
from
aws_lightsail_bucket
group by
region;

List buckets with public access

Review your Lightsail buckets that have public access enabled to ensure they are appropriately secured.

select
name,
region,
access_rules ->> 'GetObject' as public_access
from
aws_lightsail_bucket
where
access_rules ->> 'GetObject' = 'public';
select
name,
region,
json_extract(access_rules, '$.GetObject') as public_access
from
aws_lightsail_bucket
where
json_extract(access_rules, '$.GetObject') = 'public';

List buckets created within the last 30 days

Monitor newly created Lightsail buckets to track changes in your storage environment.

select
name,
created_at
from
aws_lightsail_bucket
where
created_at >= (current_date - interval '30' day);
select
name,
created_at
from
aws_lightsail_bucket
where
created_at >= date('now', '-30 day');

Buckets without tags

Identify Lightsail buckets that do not have any tags assigned to ensure that all resources are properly categorized.

select
name,
tags
from
aws_lightsail_bucket
where
tags is null
or tags = '[]';
select
name,
tags
from
aws_lightsail_bucket
where
tags is null
or tags = '[]';

Details of buckets with versioning enabled

Explore the configuration of Lightsail buckets that have object versioning enabled to manage data retention effectively.

select
name,
object_versioning
from
aws_lightsail_bucket
where
object_versioning = 'Enabled';
select
name,
object_versioning
from
aws_lightsail_bucket
where
object_versioning = 'Enabled';

Get access log config details for the buckets

Retrieve details about the access log configuration for each Lightsail bucket, including whether access logging is enabled, the destination for the logs, and any configured prefix.

select
name,
access_log_config ->> 'Enabled' as access_log_enabled,
access_log_config ->> 'Destination' as access_log_destination,
access_log_config ->> 'Prefix' as access_log_prefix
from
aws_lightsail_bucket;
select
name,
json_extract(access_log_config, '$.Enabled') as access_log_enabled,
json_extract(access_log_config, '$.Destination') as access_log_destination,
json_extract(access_log_config, '$.Prefix') as access_log_prefix
from
aws_lightsail_bucket;

Schema for aws_lightsail_bucket

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
able_to_update_bundlebooleanIndicates whether the bundle that is currently applied to a bucket can be changed to another bundle. You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.
access_log_configjsonbAn object that describes the access log configuration for the bucket.
access_rulesjsonbAn object that describes the access rules of the bucket.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Amazon Resource Name (ARN) of the bucket.
bundle_idtextThe ID of the bundle currently applied to the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.
created_attimestamp with time zoneThe timestamp when the bucket was created.
locationjsonbAn object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.
nametext=The name of the bucket.
object_versioningtextIndicates whether object versioning is enabled for the bucket. The following options can be configured: Enabled, Suspended, NeverEnabled.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
readonly_access_accountsjsonbAn array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.
regiontextThe AWS Region in which the resource is located.
resource_typetextThe Lightsail resource type of the bucket.
resources_receiving_accessjsonbAn array of objects that describe Lightsail instances that have access to the bucket.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
state_codetextThe state code of the bucket.
state_messagetextA message that describes the state of the bucket.
support_codetextThe support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags assigned to the instance.
titletextTitle of the resource.
urltextThe URL of the bucket.

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_lightsail_bucket