Snowflake user for Renta
Renta connects to Snowflake as a regular service user and works inside one database and one schema. This page sets up that side of the integration: a dedicated role, the user itself, a warehouse to run the loads, the target database and schema, and the grants that tie them together.
Run everything from an account that holds ACCOUNTADMIN. The script switches roles as it goes, and only ACCOUNTADMIN can assume every role it needs.
Warehouse strategy
Decide first which warehouse runs the loads, because the rest of the setup grants access to it.
| Warehouse strategy | Description |
|---|---|
| Exclusive warehouse for Renta | A dedicated warehouse, created in step 3. Loads never compete with your analytical queries for compute, and you pay for a second warehouse. |
| Shared warehouse | An existing warehouse, which costs nothing extra. Renta loads incrementally and uses little compute, though a load can still contend with other workloads at peak times. |
For a shared warehouse, point warehouse_name at it in step 1 and run only the two GRANT statements at the end of step 3.
Step 1. Set the configuration variables
Open a SQL worksheet in the Snowflake console and run the variables first. Every later step reads them, so keep the whole setup in this one worksheet: the values live for the session and a reconnect clears them.
Replace TempP@ssw0rd123 with a strong password before you run anything. This is the password Renta signs in with.
SET role_name = 'RENTA_ROLE';
SET user_name = 'RENTA_USER';
SET user_password = 'TempP@ssw0rd123'; -- IMPORTANT: change before execution
SET warehouse_name = 'RENTA_WAREHOUSE';
SET database_name = 'RENTA_DATABASE';
SET schema_name = 'RENTA';Write these values down. You enter the warehouse, database, schema, user, and password into the Snowflake connection form in Renta.
Step 2. Create the role and the user
The role carries every privilege, and the user only inherits it. Separating the two lets you audit and revoke access without touching the account.
USE ROLE securityadmin;
-- Role for Renta operations
CREATE ROLE IF NOT EXISTS IDENTIFIER($role_name)
COMMENT = 'Role for Renta ELT service operations';
-- Place the role in the hierarchy under SYSADMIN
GRANT ROLE IDENTIFIER($role_name) TO ROLE SYSADMIN;
-- Service user Renta signs in as
CREATE USER IF NOT EXISTS IDENTIFIER($user_name)
PASSWORD = $user_password
DEFAULT_ROLE = $role_name
DEFAULT_WAREHOUSE = $warehouse_name
MUST_CHANGE_PASSWORD = FALSE
COMMENT = 'Service account for Renta ELT operations';
GRANT ROLE IDENTIFIER($role_name) TO USER IDENTIFIER($user_name);Use this service account for Renta only. A shared account makes it impossible to tell Renta's statements apart from anyone else's in the query history.
Step 3. Create the warehouse
The warehouse supplies the compute for every load. It starts suspended and resumes on the first query, so it costs nothing between runs.
USE ROLE sysadmin;
CREATE WAREHOUSE IF NOT EXISTS IDENTIFIER($warehouse_name)
WITH
WAREHOUSE_SIZE = 'XSMALL' -- adjust to your workload
AUTO_SUSPEND = 300 -- suspend after 5 minutes of inactivity
AUTO_RESUME = TRUE -- resume when a query arrives
INITIALLY_SUSPENDED = TRUE
COMMENT = 'Dedicated warehouse for Renta ELT operations';
GRANT USAGE ON WAREHOUSE IDENTIFIER($warehouse_name) TO ROLE IDENTIFIER($role_name);
GRANT OPERATE ON WAREHOUSE IDENTIFIER($warehouse_name) TO ROLE IDENTIFIER($role_name);On a shared warehouse, run only the two GRANT statements.
Step 4. Create the database and schema
Renta writes its tables into one schema of one database. Ownership moves to SYSADMIN so the objects stay manageable outside the ACCOUNTADMIN role.
USE ROLE accountadmin;
CREATE DATABASE IF NOT EXISTS IDENTIFIER($database_name)
COMMENT = 'Database for Renta ELT data and transformations';
GRANT OWNERSHIP ON DATABASE IDENTIFIER($database_name) TO ROLE sysadmin COPY CURRENT GRANTS;
USE ROLE sysadmin;
SET use_db_stmt = 'USE DATABASE ' || $database_name;
EXECUTE IMMEDIATE $use_db_stmt;
CREATE SCHEMA IF NOT EXISTS IDENTIFIER($schema_name)
COMMENT = 'Main schema for Renta ELT tables and views';Step 5. Grant the permissions
These grants let the role create objects in the schema and work with the data inside them. The grants on future tables and views matter most: Renta creates a table per pipeline, and without them every new table would need a manual grant.
-- Database level
GRANT USAGE ON DATABASE IDENTIFIER($database_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE SCHEMA ON DATABASE IDENTIFIER($database_name) TO ROLE IDENTIFIER($role_name);
-- Object creation inside the schema
GRANT USAGE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE TABLE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE VIEW ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE STAGE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE FILE FORMAT ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE SEQUENCE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE FUNCTION ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE PROCEDURE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE PIPE ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE STREAM ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
GRANT CREATE TASK ON SCHEMA IDENTIFIER($schema_name) TO ROLE IDENTIFIER($role_name);
-- Existing objects
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA IDENTIFIER($schema_name)
TO ROLE IDENTIFIER($role_name);
GRANT SELECT ON ALL VIEWS IN SCHEMA IDENTIFIER($schema_name)
TO ROLE IDENTIFIER($role_name);
-- Objects created later
GRANT SELECT, INSERT, UPDATE, DELETE ON FUTURE TABLES IN SCHEMA IDENTIFIER($schema_name)
TO ROLE IDENTIFIER($role_name);
GRANT SELECT ON FUTURE VIEWS IN SCHEMA IDENTIFIER($schema_name)
TO ROLE IDENTIFIER($role_name);Step 6. Check the result
Read back what the setup produced before you create the connection.
SHOW ROLES LIKE 'RENTA_ROLE';
SHOW USERS LIKE 'RENTA_USER';
SHOW WAREHOUSES LIKE 'RENTA_WAREHOUSE';
SHOW DATABASES LIKE 'RENTA_DATABASE';
SHOW GRANTS TO ROLE IDENTIFIER($role_name);
SHOW SCHEMAS IN DATABASE IDENTIFIER($database_name);Then open the Snowflake destination page and fill in the connection form with the values from step 1. Renta verifies the connection when you click Save.
Ready to get started?
Build your data pipeline today or get a personalized demo. Start free!
Need help?
Get expert support to ensure your project succeeds. We're here to help!
Feature requests?
Help shape our product! Share your ideas for new features and integrations.