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_idfrom cloudflare_r2_bucketwhere account_id = 'fb1696f453testaccount39e734f5f96e9';
select name, creation_date, region, account_idfrom cloudflare_r2_bucketwhere 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_configurationfrom cloudflare_r2_bucketwhere server_side_encryption_configuration is null and account_id = 'fb1696f453testaccount39e734f5f96e9';
select name, server_side_encryption_configurationfrom cloudflare_r2_bucketwhere 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_configurationfrom cloudflare_r2_bucketwhere creation_date >= now() - interval '30' day and account_id = 'fb1696f453testaccount39e734f5f96e9';
select name, server_side_encryption_configurationfrom cloudflare_r2_bucketwhere creation_date >= datetime('now', '-30 days') and account_id = 'fb1696f453testaccount39e734f5f96e9';
Schema for cloudflare_r2_bucket
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_id | text | = | ID of the account. |
cors | jsonb | The CORS configuration for the bucket. | |
creation_date | timestamp with time zone | The date and time when bucket was created. | |
name | text | = | The user friendly name of the bucket. |
region | text | The date and time when bucket was created. | |
server_side_encryption_configuration | jsonb | The default encryption configuration for the bucket. | |
title | text | Title of the resource. |
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