ALTER EXTERNAL VOLUME

statementsupportedIceberg & external tables

docs.snowflake.com ↗

Object: EXTERNAL VOLUME

Modifies the properties for an existing external volume.

Syntax

supportedpartialnot supportednot scored

ALTER EXTERNAL VOLUME [ IF EXISTS ] <name> ADD STORAGE_LOCATION =
  (
    NAME = '<storage_location_name>'
    cloudProviderParams
  )

ALTER EXTERNAL VOLUME [ IF EXISTS ] <name> REMOVE STORAGE_LOCATION '<storage_location_name>'

ALTER EXTERNAL VOLUME [ IF EXISTS ] <name> UPDATE
  STORAGE_LOCATION = '<s3_compatible_storage_location_name>'
  CREDENTIALS = (
    AWS_KEY_ID = '<string>'
    AWS_SECRET_KEY = '<string>'
  )

ALTER EXTERNAL VOLUME [ IF EXISTS ] <name> SET ALLOW_WRITES = { TRUE | FALSE }

ALTER EXTERNAL VOLUME [ IF EXISTS ] <name> SET COMMENT = '<string_literal>'

Where

cloudProviderParams (for Amazon S3) ::=
  STORAGE_PROVIDER = '{ S3 | S3CHINA | S3GOV }'
  STORAGE_AWS_ROLE_ARN = '<iam_role>'
  STORAGE_BASE_URL = '<protocol>://<bucket>[/<path>/]'
  [ STORAGE_AWS_ACCESS_POINT_ARN = '<string>' ]
  [ ENCRYPTION = ( [ TYPE = 'AWS_SSE_S3' ] |
              [ TYPE = 'AWS_SSE_KMS' [ KMS_KEY_ID = '<string>' ] ] |
              [ TYPE = 'NONE' ] ) ]
  [ USE_PRIVATELINK_ENDPOINT = { TRUE | FALSE } ]

Where

cloudProviderParams (for Google Cloud Storage) ::=
  STORAGE_PROVIDER = 'GCS'
  STORAGE_BASE_URL = 'gcs://<bucket>[/<path>/]'
  [ ENCRYPTION = ( [ TYPE = 'GCS_SSE_KMS' ] [ KMS_KEY_ID = '<string>' ] |
              [ TYPE = 'NONE' ] ) ]

Where

cloudProviderParams (for Microsoft Azure) ::=
  STORAGE_PROVIDER = 'AZURE'
  AZURE_TENANT_ID = '<tenant_id>'
  [ USE_PRIVATELINK_ENDPOINT = { TRUE | FALSE } ]
  STORAGE_BASE_URL = 'azure://<account>.blob.core.windows.net/<container>[/<path>/]'

Parameters

NameRequiredDescription
nameSpecifies the identifier for the external volume to alter. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements.
ADD STORAGE_LOCATION = ( NAME = 'storage_location_name' cloudProviderParams )Adds a named storage location to the external volume definition. To add multiple storage locations, execute an ALTER EXTERNAL VOLUME statement for each storage location. Note Apache Iceberg™ tables write to and read from the first storage location in the set that is located in the same region as your Snowflake account. To view the external volume definition and storage location regions, execute DESCRIBE EXTERNAL VOLUME.
REMOVE STORAGE_LOCATION 'storage_location_name'Removes the specified storage location from the external volume definition. To remove multiple storage locations, execute an ALTER EXTERNAL VOLUME statement for each storage location. Note The ALTER EXTERNAL VOLUME statement fails if you attempt to remove the active storage location used by Iceberg tables in your account.
UPDATE STORAGE_LOCATION = 's3_compatible_storage_location_name'Updates the specified S3-compatible storage location from the external volume definition.
CREDENTIALS = ( AWS_KEY_ID = 'string' AWS_SECRET_KEY = 'string' )Specifies updated security credentials for connecting to and accessing an S3-compatible storage location.
SET ...Specifies one or more properties/parameters to set for the external volume (separated by blank spaces, commas, or new lines):
ALLOW_WRITES = { TRUE | FALSE }Specifies whether write operations are allowed for the external volume. TRUE specifies that write operations are allowed. This parameter must be set to TRUE for the following tables: Iceberg tables that use Snowflake as the catalog. Iceberg tables that use an external catalog and are writable. Externally managed Iceberg tables are writable when you access them through a catalog-linked database that has the ALLOWED_WRITE_OPERATIONS parameter set to TRUE. FALSE specifies that write operations aren’t allowed. You can’t change the value of this parameter to FALSE if there are Snowflake-managed Iceberg tables associated with the external volume.
COMMENT = 'string_literal'String (literal) that specifies a comment for the external volume.
STORAGE_PROVIDER = '{ S3 | S3CHINA | S3GOV }'Specifies the cloud storage provider that stores your data files. 'S3': S3 storage in public AWS regions outside of China. 'S3CHINA': S3 storage in public AWS regions in China. Supported only for Snowflake accounts in the China region; you can’t use S3CHINA from accounts in other regions. 'S3GOV': S3 storage in AWS government regions.
STORAGE_AWS_ROLE_ARN = iam_roleSpecifies the Amazon Resource Name (ARN) of the AWS identity and access management (IAM) role that grants privileges on the S3 bucket containing your data files. For more information, see Configuring secure access to Amazon S3.
STORAGE_BASE_URL = 'protocol://bucket[/path/]'Specifies the base URL for your cloud storage location, where: protocol is one of the following: s3 refers to S3 storage in public AWS regions outside of China. s3china refers to S3 storage in public AWS regions in China. s3gov refers to S3 storage in government regions. bucket is the name of an S3 bucket that stores your data files or the bucket-style alias for an S3 bucket access point. For an S3 access point, you must also specify a value for the STORAGE_AWS_ACCESS_POINT_ARN parameter. path is an optional path that can be used to provide granular control over objects in the bucket.
STORAGE_AWS_ACCESS_POINT_ARN = 'string'Specifies the Amazon resource name (ARN) for your S3 access point. Required only when you specify an S3 access point alias for your storage STORAGE_BASE_URL.
ENCRYPTION = ( [ TYPE = 'AWS_SSE_S3' ] | [ TYPE = 'AWS_SSE_KMS' [ KMS_KEY_ID = 'string' ] ] | [ TYPE = 'NONE' ] )Specifies the properties needed to encrypt data on the external volume.
TYPE = ...Specifies the encryption type used. Possible values are: AWS_SSE_S3 : Server-side encryption using S3-managed encryption keys. For more information, see Using server-side encryption with Amazon S3-managed encryption keys (SSE-S3). AWS_SSE_KMS : Server-side encryption using keys stored in KMS. For more information, see Using server-side encryption with AWS Key Management Service (SSE-KMS). NONE: No encryption.
KMS_KEY_ID = 'string' (applies to AWS_SSE_KMS encryption only)Optionally specifies the ID for the AWS KMS-managed key used to encrypt files written to the bucket. If no value is provided, your default KMS key is used to encrypt files for writing data. Note that this value is ignored when reading data.
USE_PRIVATELINK_ENDPOINT = { TRUE | FALSE }Specifies whether to use outbound private connectivity to harden your security posture. For information about using this parameter, see Private connectivity to external volumes for Amazon Web Services.
STORAGE_PROVIDER = 'GCS'Specifies the cloud storage provider that stores your data files.
STORAGE_BASE_URL = 'gcs://bucket[/path/]'Specifies the base URL for your cloud storage location, where: bucket is the name of a Cloud Storage bucket that stores your data files. path is an optional path that can be used to provide granular control over objects in the bucket.
ENCRYPTION = ( [ TYPE = 'GCS_SSE_KMS' ] [ KMS_KEY_ID = 'string' ] | [ TYPE = 'NONE' ] )Specifies the properties needed to encrypt data on the external volume.
TYPE = ...Specifies the encryption type used. Possible values are: GCS_SSE_KMS: Server-side encryption using keys stored in KMS. For more information, see customer-managed encryption keys. NONE: No encryption.
KMS_KEY_ID = 'string' (applies to GCS_SSE_KMS encryption only)Specifies the ID for the Cloud KMS-managed key that is used to encrypt files written to the bucket. This value is ignored when reading data. The read operation should succeed if the service account has sufficient permissions to the data and any specified KMS keys.
STORAGE_PROVIDER = 'AZURE'Specifies the cloud storage provider that stores your data files.
AZURE_TENANT_ID = 'tenant_id'Specifies the ID for your Office 365 tenant that the allowed and blocked storage accounts belong to. An external volume can authenticate to only one tenant, so the allowed and blocked storage locations must refer to storage accounts that all belong to this tenant. To find your tenant ID, log into the Azure portal and click Azure Active Directory » Properties. The tenant ID is displayed in the Tenant ID field.
USE_PRIVATELINK_ENDPOINT = { TRUE | FALSE }Specifies whether to use outbound private connectivity to harden your security posture. For information about using this parameter, see Private connectivity to external volumes for Microsoft Azure.
STORAGE_BASE_URL = 'azure://account.blob.core.windows.net/container[/path/]'Specifies the base URL for your cloud storage location, where: account is the name of your Azure account; for example, myaccount. container is the name of an Azure container that stores your data files. path is an optional path that can be used to provide granular control over logical directories in the container.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP | External volume | OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege). For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by