Skip to main content

external_volumes

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

Overview

Nameexternal_volumes
TypeResource
Idsnowflake.external_volume.external_volumes

Fields

NameDatatypeDescription
namestringString that specifies the identifier (the name) for the external volume; must be unique in your account.
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_onstringDate and time when the external volume was created.
ownerstringRole that owns the external volume
owner_role_typestringThe type of role that owns the external volume
storage_locationsarraySet of named cloud storage locations in different regions and, optionally, cloud platforms.

Methods

NameAccessible byRequired ParamsOptional ParamsDescription
fetch_external_volumeSELECTname, endpoint-Fetch an external volume
list_external_volumesSELECTendpointlikeList external volumes
create_external_volumeINSERTdata__name, data__storage_locations, endpointcreateModeCreate an external volume
delete_external_volumeDELETEname, endpointifExistsDelete an external volume
undrop_external_volumeEXECname, endpoint-Undrop an external volume

Optional Parameter Details
NameDescriptionTypeDefault
createModeQuery 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.stringerrorIfExists
ifExistsQuery 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.booleanfalse
likeQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.string-

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new external_volumes resource.

/*+ create */
INSERT INTO snowflake.external_volume.external_volumes (
data__name,
data__storage_locations,
data__allow_writes,
data__comment,
endpoint
)
SELECT
'{{ name }}',
'{{ storage_locations }}',
'{{ allow_writes }}',
'{{ comment }}',
'{{ endpoint }}'
;

DELETE example

Deletes the specified external_volumes resource.

/*+ delete */
DELETE FROM snowflake.external_volume.external_volumes
WHERE name = '{{ name }}'
AND endpoint = '{{ endpoint }}';