Connecting to Snowflake

Connect your Snowflake account to CloudZero to bring your Snowflake cost and usage data, including Cortex AI spend, into a unified view of all your cloud and SaaS spend. CloudZero organizes your Snowflake costs, along with your other costs, into categories (called Dimensions) that matter most to your business. For example: business unit, team, product, feature, environment, customer, or virtually anything else. Once connected and organized, you can quickly answer questions about your spend that matter to your stakeholders.

This guide covers configuring a Snowflake connection and running the CloudZero SQL script in your Snowflake account. CloudZero connects through Snowflake's Secure Data Sharing, establishing a share from your account to CloudZero's Snowflake account in the same region. All access is read-only.

ℹ️

CloudZero supports all Snowflake regions except government cloud regions (SnowGov).

What you need

  • CloudZero user with admin permissions
  • Snowflake account with permissions to create roles, databases, procedures, and shares (the SQL script creates read-only resources)
  • Your Snowflake contract pricing:
ValueHow to find it
Cost Per Credit (Capacity Credit Price)Query the Rate_Sheet_Daily view, or find it on your Snowflake bill
Cost Per TB Month (Capacity Storage Price)Same source as Cost Per Credit
Cost Effective DateThe date your current pricing took effect
⚠️

Do not connect Snowflake reader accounts. The provider account assumes all credit charges for reader account usage.

Step 1: Configure the connection in CloudZero

  1. In CloudZero, go to Settings > Cloud Connections.

  2. Select Create Connection + and select the Snowflake tile.

  3. Enter the connection details:

    FieldValue
    Connection NameA display name for this connection in CloudZero
    Cost Per CreditYour Snowflake Capacity Credit Price
    Cost Per TB MonthYour Snowflake Capacity Storage Price
    Cost Effective DateThe date your pricing took effect. If your pricing has not changed since the account was created, use the account creation date.
    Snowflake Account IDRun SELECT LOWER(CURRENT_ACCOUNT()); in Snowflake
    Snowflake Account RegionRun the following in Snowflake: SHOW REGIONS; SELECT display_name FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())) WHERE snowflake_region = CURRENT_REGION();
  4. Select Save. A SQL script appears on the next screen.

Step 2: Run the CloudZero SQL script in Snowflake

  1. Copy the SQL script from the CloudZero screen.
  2. Paste it into a Snowflake worksheet in your account.
  3. Select the All Queries checkbox.
  4. Select Run.
ℹ️

The first run can take 3+ hours if your billing tables have not been queried before. Subsequent runs take minutes.

Step 3: Verify the connection

Return to Settings > Cloud Connections in CloudZero and refresh. Your Snowflake connection appears in the Billing Connections table.

What to expect

After CloudZero discovers the share, the connection status changes from Pending Data to Healthy:

  • Discovery: Up to an hour after the SQL script completes.
  • Cost data in Explorer: Up to 24 hours for the initial sync.
  • Additional accounts: Connect each Snowflake account individually using the same process.

If CloudZero loses access to the share, the connection status changes and displays details about the issue.

You can also query your CloudZero cost data directly from your own Snowflake account. See Query CloudZero Data in Snowflake for setup instructions.

Connection details

Tag support

Snowflake tags are available in CloudZero for serverless features but not for standard warehouse queries:

Usage typeExamplesTags in CloudZero
Serverless featuresSnowpipe, search optimization, automatic clusteringYes. Tags on the associated table, schema, or database are available throughout CloudZero, including for cost allocation with CostFormation.
Warehouse queriesStandard user-driven queriesNo. Usage is tracked at the warehouse level only.

If tags are not appearing for a serverless feature, verify the tag is applied to the object, schema, or database in your Snowflake account using the TAG_REFERENCES view.

Permissions

All CloudZero access is read-only. The SQL script in Step 2 creates the following resources in your Snowflake account and establishes a share to CloudZero:

ResourceNamePurpose
RoleCLOUDZERO_COPY_BILLING_DATA_ROLEReads data and executes the sync procedure
DatabaseCLOUDZERO_SHARED_DATAIntermediate database between your billing views and the share
ProcedureCLOUDZERO_COPY_BILLING_DATASyncs data periodically from billing tables and views
ShareCLOUDZERO_SHAREShares data from CLOUDZERO_SHARED_DATA to CloudZero

The script grants read access to the following tables and views:

SchemaTable / ViewPurpose
ACCOUNT_USAGEMETERING_HISTORYCredit usage by warehouse
ACCOUNT_USAGEMETERING_DAILY_HISTORYDaily credit usage by warehouse
ACCOUNT_USAGEDATABASE_STORAGE_USAGE_HISTORYStorage usage by database
ACCOUNT_USAGESTAGE_STORAGE_USAGE_HISTORYStorage usage by stage
ACCOUNT_USAGEWAREHOUSE_EVENTS_HISTORYWarehouse lifecycle events
ACCOUNT_USAGEQUERY_HISTORYQuery execution details (the query_text column is excluded)
ACCOUNT_USAGETAGSTag definitions
ACCOUNT_USAGETAG_REFERENCESTag assignments to objects
ORGANIZATION_USAGEUSAGE_IN_CURRENCY_DAILYOrganization-level spend
ORGANIZATION_USAGEREMAINING_BALANCE_DAILYContract balance tracking
ORGANIZATION_USAGERATE_SHEET_DAILYContract pricing rates

CloudZero also collects Cortex AI usage data to surface AI-driven spend alongside the rest of your Snowflake costs:

SchemaTable / ViewPurpose
ACCOUNT_USAGECORTEX_AGENT_USAGE_HISTORYAgent workflows
ACCOUNT_USAGECORTEX_AI_FUNCTIONS_USAGE_HISTORYAI function invocations
ACCOUNT_USAGECORTEX_ANALYST_USAGE_HISTORYNatural language queries
ACCOUNT_USAGECORTEX_CODE_CLI_USAGE_HISTORYCode generation (CLI)
ACCOUNT_USAGECORTEX_CODE_SNOWSIGHT_USAGE_HISTORYCode generation (Snowsight)
ACCOUNT_USAGECORTEX_DOCUMENT_PROCESSING_USAGE_HISTORYDocument processing
ACCOUNT_USAGECORTEX_REST_API_USAGE_HISTORYREST API calls
ACCOUNT_USAGECORTEX_SEARCH_BATCH_QUERY_USAGE_HISTORYSearch batch queries
ACCOUNT_USAGECORTEX_SEARCH_DAILY_USAGE_HISTORYSearch daily totals
ACCOUNT_USAGECORTEX_SEARCH_SERVING_USAGE_HISTORYSearch serving

Maintenance and configuration

Deleting a connection

Snowflake connections cannot be deleted through the CloudZero UI. Contact your account manager to remove a Snowflake connection.

Updating a manual connection

If you have a non-us-east-1 Snowflake connection that uses the legacy S3-based ingestion method, update the IAM trust relationship. See Update a Legacy Snowflake Connection for details.

ℹ️

Have questions or feedback? Reach out to your account manager.