Setting up access to Snowflake can be done in a few simple steps.
First, log in to your Snowflake account and open up an SQL worksheet, or connect to Snowflake using your SQL console of choice.
Then, run the following SQL commands:
- Ensure that the role for the session is set to accountadmin in order to grant privileges
USE ROLE accountadmin;
- [Optional] Create a new database for Alooma
CREATE DATABASE <database> ;
- [Optional] Create a new schema for Alooma
CREATE SCHEMA <database.schema>;
- Create the role that will be used by the Alooma user
CREATE ROLE alooma_role;
- Grant database privileges to the role (regardless of whether a new database was created in step 2)
GRANT USAGE ON DATABASE <database> TO ROLE alooma_role;
GRANT CREATE SCHEMA ON DATABASE <database> TO ROLE alooma_role;
- Grant schema privileges to the role (regardless of whether a new schema was created in step 3)
GRANT ALL ON SCHEMA <database>.<schema> TO ROLE alooma_role;
- Create the user for Alooma's Snowflake connection
CREATE USER alooma PASSWORD='<password>' DEFAULT_ROLE = alooma_role;
- Grant alooma_role privileges to the alooma user
GRANT ROLE alooma_role TO USER alooma;
- Grant alooma_role privileges over the selected warehouse
GRANT ALL ON WAREHOUSE <WAREHOUSE_NAME> TO <alooma_role>;
That's it, you're done configuring access, time to connect to Snowflake.
If you need support or prefer to use a pre-existing user, role, or other option, contact us and we'll be happy to help you get set up.