Snowflake cost connection
IP RESTRICTIONS
Make sure to allow traffic from one of the Paradime IPs in your firewall depending on the data location selected.
👉 See also: Paradime IP addresses.
1. Snowflake setup guide
Create a Snowflake role and user
-- 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
-- 2.### create warehouse
use role sysadmin;
create warehouse if not exists paradime_warehouse
warehouse_size=xsmall
auto_suspend=60
initially_suspended=true
comment = 'Used by paradime.io for cost analytics';
grant monitor, operate, usage, modify
on warehouse paradime_warehouse to role paradime_cost_role;
Create S3 integration
-- 3.### Create S3 integration
use role accountadmin;
create or replace storage integration PARADIME_S3_STORAGE_INTEGRATION
type = external_stage
storage_provider = 'S3'
enabled = true
STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::817727247863:role/paradime-snowflake-role-<your_paradime_region>-<your_company_token>' -- replace company token and region before running this command
STORAGE_ALLOWED_LOCATIONS = ('s3://paradime-s3-<your_company_token>-<your_paradime_region>/snowflake/'); -- replace company token and region before running this command
grant usage on integration PARADIME_S3_STORAGE_INTEGRATION to role paradime_cost_role;
-- 3.### Optional when using a named stage
use role accountadmin;
create stage PARADIME_COST_ANALYTICS.CORE.PARADIME_EXPORT
url='s3://paradime-s3-<your_company_token>-<your_paradime_region>/snowflake/' -- replace company token and region before running this command
storage_integration = PARADIME_S3_STORAGE_INTEGRATION;
grant usage on stage PARADIME_COST_ANALYTICS.CORE.PARADIME_EXPORT to role paradime_cost_role;
Create a new database and schema for Paradime
-- 4. ### create paradime db and schemas and grant access
use role accountadmin;
create or replace database PARADIME_COST_ANALYTICS;
create or replace schema PARADIME_COST_ANALYTICS.CORE;
grant usage on database PARADIME_COST_ANALYTICS to role paradime_cost_role;
grant usage on schema PARADIME_COST_ANALYTICS.CORE to role paradime_cost_role;
Create a new Snowflake file format
-- 5.### Create fileformat and grant privileges
use role accountadmin;
create or replace file format PARADIME_COST_ANALYTICS.CORE.PARADIME_JSON_FORMAT
type = JSON
NULL_IF = ();
grant all privileges on file format PARADIME_COST_ANALYTICS.CORE.PARADIME_JSON_FORMAT to paradime_cost_role;
Grant access to Snowflake metadata to the Paradime user
-- 6.### grant access to Snowflake metadata
use role accountadmin;
grant imported privileges on database snowflake to role paradime_cost_role;
Enable the Paradime user to manage and monitor Snowflake Warehouses
-- 7.### grant access to monitor warehouses
use role accountadmin;
grant monitor usage on account to role paradime_cost_role;
--- ### grant paradime the access to manage warehouses
use role accountadmin;
grant manage warehouses on account to role paradime_cost_role;
--- ### grant paradime the access to manage tasks
use role accountadmin;
grant create TASK on schema PARADIME_COST_ANALYTICS.CORE to role paradime_cost_role;
grant execute TASK on ACCOUNT TO ROLE paradime_cost_role;
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:
--- ### check the rate_sheet_daily view contains data
use role accountadmin;
select * from snowflake.organization_usage.rate_sheet_daily;

Purchased your Snowflake credits through a reseller?
If you purchased your Snowflake contract or credits through a reseller, such as the AWS Marketplace, you will not have access to the organization_usage
views even after executing the steps mentioned above to enable the ORGADMIN role.
Share a copy of your latest Snowflake invoice with the Paradime team (via chat or by emailing [email protected] so that we can manually input the applicable rates for your account.
Full script here 👇
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.
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.
query-comment:
comment: '{{ get_query_comment(node) }}'
append: true
3. Configured Cost connection in Paradime
Add a Snowflake Cost Connection
Click "Settings" in the top menu bar of the Paradime interface.
Click "Connections" in the left sidebar.
Click "Add New" next to the Radar Environment.
Select "Snowflake" as the connection type.
Step 2: Enter the Required Credentials
After selecting Snowflake, provide the following details:
Snowflake Account Identifier
Paradime Cost Database:
PARADIME_COST_ANALYTICS
If using the Key-Pair auth method, simply enter:
Username:
paradime_cost_user
Private Key: The Private Key generated and linked to the user. You must include the commented lines when adding the Private Key.
Passphrase (Optional): (Use the passphrase created when generating the encrypted)
Last updated
Was this helpful?