Snowflake cost connection

1. Snowflake setup guide

Create a Snowflake role and user

Generate a password for the Paradime user and replace the placeholder text <your_generated_password_here> in the step below.

-- 1.### create user and role

use role useradmin;
create user if not exists paradime_cost_user
  password = '<your_generated_password_here>'
  default_role = paradime_cost_role
  default_warehouse = paradime_warehouse
  comment = 'Used by paradime.io for cost analytics';

create role if not exists paradime_cost_role comment = 'Used by paradime.io for cost analytics';
grant role paradime_cost_role to role sysadmin;
grant role paradime_cost_role to user paradime_cost_user;

Create a Snowflake warehouse

Create S3 integration

Before running this command, you will need to update STORAGE_AWS_ROLE_ARN and STORAGE_ALLOWED_LOCATIONS with your own region and company token.

You can find the region and company token in the Paradime workspace settings page. Company & Workspace token

If you have set PREVENT_UNLOAD_TO_INLINE_URL to true, you can optionally use a named stage. To set this up run the below script. Before running this command, you will need to update URL with your own region and company token. You can find the region and company token in the Paradime workspace settings page. Company & Workspace token

Create a new database and schema for Paradime

Create a new Snowflake file format

Grant access to Snowflake metadata to the Paradime user

Enable the Paradime user to manage and monitor Snowflake Warehouses

Ensure your account has ORGADMIN access

Paradime relies on views from the snowflake.organization_usage such as the snowflake.organization_usage.rate_sheet_daily view is used to retrieve your daily rate for each Snowflake service (example the cost per credit for compute resources and cost per terabyte for storage).

To verify if these views are populated in your account, please execute the following SQL statement:

If records are returned, you're all set 🙌

-------

If the SQL statement returns no records, it likely means that the ORGADMIN role is not enabled for the account. To enable it, follow these steps:

  1. Log into a Snowflake account within your organization that has the ORGADMIN role enabled (at least one account should have this role).

  2. Navigate to the sidebar and click on "Admin" and then "Accounts".

  3. Locate the account you want to connect to Paradime enable the ORGADMIN role for that account.

💡 It can take up to 1 day for these views become populated with data after running this statement

Purchased your Snowflake credits through a reseller?

Full script here 👇

Snowflake setup guide script

2. dbt™️ project setup guide

Create a macro to manage query comments

To enable Paradime to enrich your Snowflake queries with additional metadata you will need to create a new dbt™️ macro called get_query_comment.sql in the macros folder of your project.

get_query_comment.sql dbt™️ macro

Update your dbt_project.yml file

This step ensures that with each dbt™️ run, the query comment is appended to the query running in Snowflake.

3. Configured Cost connection in Paradime

From the account setting page of your Paradime workspace, add your new Snowflake Cost connection using the credentials below:

  • You Snowflake Account Identifier

  • The Paradime Database created during the Snowflake Setup. This is named as: PARADIME_COST_ANALYTICS

  • The Paradime cost username and password, where the username is paradime_cost_user, and the password generated during the setup.

Last updated

Was this helpful?