CREATE STORAGE
The CREATE STORAGE statement creates a named connection to external object storage such as Amazon S3 or Google Cloud Storage (GCS).
|
In Redpanda Cloud, the storage connection and Iceberg catalog used to query Iceberg-enabled topics are configured and managed automatically when you enable Redpanda SQL on a cluster that has an Iceberg REST catalog configured. You don’t run these statements yourself for that workflow. This page documents the statement’s syntax and options so you can understand what Redpanda Cloud configures. See Query Iceberg-enabled topics. |
Syntax
CREATE STORAGE [IF NOT EXISTS] storage_name
TYPE = S3 | GCS
WITH (option = 'value' [, ...]);
-
storage_name: Name for the new storage connection. -
TYPE: Storage type. Redpanda SQL supportsS3andGCS. -
IF NOT EXISTS: Optional. Prevents an error if a storage connection with the same name already exists.
S3 options
| Option | Type | Required | Description |
|---|---|---|---|
|
STRING |
Yes |
Cloud region for the storage bucket (for example, |
|
STRING |
Yes |
AWS access key ID. |
|
STRING |
Yes |
AWS secret access key. |
GCS options
| Option | Type | Required | Description |
|---|---|---|---|
|
STRING |
No |
GCS bucket URL, in the form |
|
STRING |
No |
Contents of a GCP service account key JSON file. If omitted, Redpanda SQL authenticates using Application Default Credentials (ADC), which includes Workload Identity Federation on Google Kubernetes Engine (GKE). |
|
STRING |
No |
Override the default GCS endpoint. |
Examples
Create an S3 storage connection
CREATE STORAGE archive_storage
TYPE = S3
WITH (
region = 'us-west-2',
access_key_id = 'AKIAIOSFODNN7EXAMPLE',
secret_access_key = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
);