CREATE EXTERNAL CONSUMER¶
Creates a new external consumer identity, or replaces an existing one, for use with Open Data Sharing. External consumers represent parties outside of Snowflake that access shared Iceberg data using the Iceberg REST Catalog API.
Syntax¶
Required parameters¶
nameSpecifies the identifier for the external consumer. Must be unique within the account.
If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
Optional parameters¶
OR REPLACEReplaces an existing external consumer with the same name. The existing consumer and its properties are replaced by the new definition.
IF NOT EXISTSCreates the external consumer only if one with the same name does not already exist. If one already exists, the command does nothing and completes successfully.
OR REPLACEandIF NOT EXISTSare mutually exclusive.COMMENT = 'string_literal'Specifies a comment for the external consumer.
EMAIL = 'email_address'Specifies the email address associated with the external consumer.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| CREATE EXTERNAL CONSUMER | Account | Required to create an external consumer. Granted to ACCOUNTADMIN by default. |
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.
Usage notes¶
- The OR REPLACE and IF NOT EXISTS clauses are mutually exclusive. They can’t both be used in the same statement.
-
CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.
- External consumers are restricted identities. You cannot grant Snowflake roles or standard user options to an external consumer.
- External consumers must authenticate using Programmatic Access Tokens (PATs). See ALTER EXTERNAL CONSUMER … ADD PAT.
Examples¶
Create an external consumer:
Create an external consumer only if one with the same name does not already exist: