Skip to main content

external_volumes

Creates, updates, deletes, gets or lists an external_volumes resource.

Overview

Nameexternal_volumes
TypeResource
Idsnowflake.external_volume.external_volumes

Fields

The following fields are returned by SELECT queries:

A Snowflake external volume

NameDatatypeDescription
namestringString that specifies the identifier (the name) for the external volume; must be unique in your account. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
allow_writesbooleanSpecifies whether write operations are allowed for the external volume; must be set to TRUE for Iceberg tables that use Snowflake as the catalog.
commentstringString (literal) that specifies a comment for the external volume.
created_onstring (date-time)Date and time when the external volume was created.
ownerstringRole that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
owner_role_typestringThe type of role that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
storage_locationsarraySet of named cloud storage locations in different regions and, optionally, cloud platforms.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_external_volumesselectendpointlikeList external volumes
fetch_external_volumeselectname, endpointFetch an external volume
create_external_volumeinsertendpointcreateModeCreate an external volume
delete_external_volumedeletename, endpointifExistsDelete an external volume
undrop_external_volumeexecname, endpointUndrop an external volume

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringOrganization and Account Name (default: orgid-acctid)
namestringIdentifier (i.e. name) for the resource.
createModestringQuery parameter allowing support for different modes of resource creation. Possible values include: - errorIfExists: Throws an error if you try to create a resource that already exists. - orReplace: Automatically replaces the existing resource with the current one. - ifNotExists: Creates a new resource when an alter is requested for a non-existent resource.
ifExistsbooleanQuery parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn't exist.
likestringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.

SELECT examples

List external volumes

SELECT
name,
allow_writes,
comment,
created_on,
owner,
owner_role_type,
storage_locations
FROM snowflake.external_volume.external_volumes
WHERE endpoint = '{{ endpoint }}' -- required
AND like = '{{ like }}';

INSERT examples

Create an external volume

INSERT INTO snowflake.external_volume.external_volumes (
data__name,
data__storage_locations,
data__allow_writes,
data__comment,
endpoint,
createMode
)
SELECT
'{{ name }}' --required,
'{{ storage_locations }}' --required,
{{ allow_writes }},
'{{ comment }}',
'{{ endpoint }}',
'{{ createMode }}'
;

DELETE examples

Delete an external volume

DELETE FROM snowflake.external_volume.external_volumes
WHERE name = '{{ name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND ifExists = '{{ ifExists }}';

Lifecycle Methods

Undrop an external volume

EXEC snowflake.external_volume.external_volumes.undrop_external_volume 
@name='{{ name }}' --required,
@endpoint='{{ endpoint }}' --required;