turbot/cloudflare
steampipe plugin install cloudflare

Table: cloudflare_r2_bucket - Query Cloudflare R2 Buckets using SQL

Cloudflare R2 is a cloud storage solution that offers high-performance, scalable, and secure object storage. It allows developers to store and retrieve any amount of data at any time from anywhere on the web. R2 buckets are the fundamental containers in Cloudflare R2 for data storage.

Table Usage Guide

The cloudflare_r2_bucket table provides insights into R2 buckets within Cloudflare. As a cloud engineer or developer, you can explore bucket-specific details through this table, including the bucket's configuration, status, and usage. Utilize it to manage and monitor your Cloudflare R2 storage, ensuring optimal performance and security.

Examples

Basic info

Explore which Cloudflare resources were created in a specific region within a given account. This could be useful to manage resource allocation and understand usage patterns across different regions.

select
name,
creation_date,
region,
account_id
from
cloudflare_r2_bucket
where
account_id = 'fb1696f453testaccount39e734f5f96e9';
select
name,
creation_date,
region,
account_id
from
cloudflare_r2_bucket
where
account_id = 'fb1696f453testaccount39e734f5f96e9';

List buckets with default encryption disabled

Explore which Cloudflare R2 buckets lack default encryption, which could potentially expose sensitive data. This query is particularly useful for identifying security vulnerabilities in your storage configuration.

select
name,
server_side_encryption_configuration
from
cloudflare_r2_bucket
where
server_side_encryption_configuration is null
and account_id = 'fb1696f453testaccount39e734f5f96e9';
select
name,
server_side_encryption_configuration
from
cloudflare_r2_bucket
where
server_side_encryption_configuration is null
and account_id = 'fb1696f453testaccount39e734f5f96e9';

List buckets created in the last 30 days

Explore which buckets have been created in the last 30 days for a specific account. This allows you to keep track of recent additions and understand the level of server-side encryption configuration for each of these new buckets.

select
name,
server_side_encryption_configuration
from
cloudflare_r2_bucket
where
creation_date >= now() - interval '30' day
and account_id = 'fb1696f453testaccount39e734f5f96e9';
select
name,
server_side_encryption_configuration
from
cloudflare_r2_bucket
where
creation_date >= datetime('now', '-30 days')
and account_id = 'fb1696f453testaccount39e734f5f96e9';

Schema for cloudflare_r2_bucket

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=ID of the account.
corsjsonbThe CORS configuration for the bucket.
creation_datetimestamp with time zoneThe date and time when bucket was created.
nametext=The user friendly name of the bucket.
regiontextThe date and time when bucket was created.
server_side_encryption_configurationjsonbThe default encryption configuration for the bucket.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
titletextTitle of the resource.
user_idtext=, !=, ~~, ~~*, !~~, !~~*ID of the current user.

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)" -- cloudflare

You can pass the configuration to the command with the --config argument:

steampipe_export_cloudflare --config '<your_config>' cloudflare_r2_bucket