Snowflake High Performance connector for Kafka: Configure Snowflake

This topic describes the steps to configure Snowflake for Snowflake High Performance connector for Kafka.

Snowflake recommends that you create a separate user, using CREATE USER and role using CREATE ROLE for each Kafka instance so that the access privileges can be individually revoked as required.

Creating a role to use the Kafka connector

The following creates a custom role for use by the Kafka connector, for example KAFKA_CONNECTOR_ROLE. The script references a specific existing database and schema (kafka_db.kafka_schema) and user (kafka_connector_user_1):

-- Use a role that can create and manage roles and privileges.
USE ROLE securityadmin;

-- Create a Snowflake role with the privileges to work with the connector.
CREATE ROLE kafka_connector_role;

-- Grant privileges on the database.
GRANT USAGE ON DATABASE kafka_db TO ROLE kafka_connector_role;

-- Grant privileges on the schema.
GRANT USAGE ON SCHEMA kafka_schema TO ROLE kafka_connector_role;

-- Grant OPERATE on pipes only if you manually created them (user-defined pipe mode).
-- GRANT OPERATE ON PIPE existing_pipe1 TO ROLE kafka_connector_role;

-- Grant INSERT on the table to insert data into.
GRANT INSERT ON TABLE kafka_schema.existing_table TO ROLE kafka_connector_role;

-- Grant the custom role to the user configured in the Kafka connector configuration properties.
GRANT ROLE kafka_connector_role TO USER kafka_connector_user;
Copy

Note that any privileges must be granted directly to the role used by the connector. Grants cannot be inherited from role hierarchy.

For more information on creating custom roles and role hierarchies, see Configuring access control.

Required privileges

The connector requires the following privileges to create and manage Snowflake objects:

Object

Privilege

When Required

Database

USAGE

Always required

Schema

USAGE

Always required

Pipe

OPERATE

If using user-defined pipes

Destination table

INSERT

Always required

Next steps

Set up Kafka.