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_atfrom aws_lightsail_bucket;
select name, arn, state_code, created_atfrom 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_countfrom aws_lightsail_bucketgroup by region;
select region, count(*) as bucket_countfrom aws_lightsail_bucketgroup 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_accessfrom aws_lightsail_bucketwhere access_rules ->> 'GetObject' = 'public';
select name, region, json_extract(access_rules, '$.GetObject') as public_accessfrom aws_lightsail_bucketwhere 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_atfrom aws_lightsail_bucketwhere created_at >= (current_date - interval '30' day);
select name, created_atfrom aws_lightsail_bucketwhere 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, tagsfrom aws_lightsail_bucketwhere tags is null or tags = '[]';
select name, tagsfrom aws_lightsail_bucketwhere 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_versioningfrom aws_lightsail_bucketwhere object_versioning = 'Enabled';
select name, object_versioningfrom aws_lightsail_bucketwhere 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_prefixfrom 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_prefixfrom aws_lightsail_bucket;
Schema for aws_lightsail_bucket
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
able_to_update_bundle | boolean | Indicates 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_config | jsonb | An object that describes the access log configuration for the bucket. | |
access_rules | jsonb | An object that describes the access rules of the bucket. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) of the bucket. | |
bundle_id | text | The 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_at | timestamp with time zone | The timestamp when the bucket was created. | |
location | jsonb | An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone. | |
name | text | = | The name of the bucket. |
object_versioning | text | Indicates whether object versioning is enabled for the bucket. The following options can be configured: Enabled, Suspended, NeverEnabled. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
readonly_access_accounts | jsonb | An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket. | |
region | text | The AWS Region in which the resource is located. | |
resource_type | text | The Lightsail resource type of the bucket. | |
resources_receiving_access | jsonb | An array of objects that describe Lightsail instances that have access to the bucket. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state_code | text | The state code of the bucket. | |
state_message | text | A message that describes the state of the bucket. | |
support_code | text | The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags assigned to the instance. | |
title | text | Title of the resource. | |
url | text | The 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