Configure an external volume for S3-compatible storage¶
For externally managed or Snowflake-managed Apache Iceberg™ tables with data and metadata in S3-compatible storage, you can configure an external volume associated with an Amazon S3-compatible storage location.
Prerequisites¶
To use S3-compatible storage for Iceberg tables, you must have an S3-compatible API endpoint for Snowflake. For more information, see Requirements for S3-compatible storage.
Create an external volume for S3-compatible storage¶
Create an external volume that specifies an S3-compatible storage location. For information about the S3-compatible parameters in the CREATE EXTERNAL VOLUME command, see the command syntax.
CREATE OR REPLACE EXTERNAL VOLUME ext_vol_s3_compat
STORAGE_LOCATIONS = (
(
NAME = 'my_s3_compat_storage_location'
STORAGE_PROVIDER = 'S3COMPAT'
STORAGE_BASE_URL = 's3compat://mybucket/unload/mys3compatdata'
CREDENTIALS = (
AWS_KEY_ID = '1a2b3c...'
AWS_SECRET_KEY = '4x5y6z...'
)
STORAGE_ENDPOINT = 'mystorage.com'
)
);
Important
If you’re configuring an external volume for externally managed Iceberg tables, you must add ALLOW_WRITES = FALSE
to
the command syntax. This line specifies that write operations aren’t allowed for the external volume. For more information, see the
command syntax for the CREATE EXTERNAL VOLUME command.
Update your external volume credentials¶
To change or update the credentials for the external volume, you can use the ALTER EXTERNAL VOLUME … UPDATE command. Specify the name of the storage location that you want to change the credentials for.
ALTER EXTERNAL VOLUME ext_vol_s3_compat UPDATE
STORAGE_LOCATION = 'my_s3_compat_storage_location'
CREDENTIALS = (
AWS_KEY_ID = '4d5e6f...'
AWS_SECRET_KEY = '7g8h9i...'
);