Connecting to Snowflake

Connections are how CloudZero manages the various Cost Sources that bring Billing, Resource, and other types of data into the platform.

📘

But First...

Every CloudZero customer must first connect an AWS Management/Payer Account to get started, so please confirm that you have followed the AWS Connection process before trying to add a Snowflake Connection.

How the Snowflake Connection Works

Connecting to a Snowflake account will show Snowflake cost data alongside other Cost Sources in the Explorer, as well as enable anomaly alerts on Snowflake spend.

CloudZero accesses your Snowflake data via a share from your account to our Snowflake account using Secure Data Sharing.

🚧

Non us-east-1 Accounts

If your Snowflake account is not in AWS us-east-1, you will have to connect in a different (but fully supported) manner. If you fall into this case please reach out to your customer success team.

📘

About CloudZero's Access to your Snowflake Accounts

All of CloudZero's permissions are Read-Only
We have no access to data except where explicitly authorized (for example, the data you explicitly share with CloudZero). The SQL script we offer through the application does require write permissions, just to create the read-only resources for you.

Summary of Permissions:

  • Roles
    • CLOUDZERO_COPY_BILLING_DATA_ROLE: role that can read data and execute sync procedure
  • Databases
    • CLOUDZERO_SHARED_DATA: database that sits between your billing views and the share with CloudZero
  • Procedures
    • CLOUDZERO_COPY_BILLING_DATA: stored procedure to sync data periodically from the billing tables/views
  • Tables/Views
    • METERING_HISTORY
    • METERING_DAILY_HISTORY
    • DATABASE_STORAGE_USAGE_HISTORY
    • STAGE_STORAGE_USAGE_HISTORY
  • Shares
    • CLOUDZERO_SHARE: shares data from CLOUDZERO_SHARED_DATA database with CloudZero Snowflake account

Connect a Snowflake Account

Open the Connections page

The Connections page can be found by going to the "gear" on the sidebar and selecting "Connections" or alternatively going to https://app.cloudzero.com/organization/connections

CloudZero ConnectionsCloudZero Connections

📘

Note: Organizer Role Required

You must be a CloudZero Organizer to add new Connections to the platform.

Add a Snowflake Connection

On the Connections page you can see all of the Connections in your system. To connect a Snowflake Account, click the “Add New Connection” button.

On the next page, click the Snowflake tile and then click the Get started button.

  1. You will need to fill in your Snowflake Account information into the next page:

    • Connection Name: This is the name you will see throughout the CloudZero UI, in addition to the Snowflake Account ID.
    • Cost Per Credit: Your Snowflake account’s Capacity Credit Price on the bill.
    • Cost Per TB Month: Your Snowflake account’s Capacity Storage Price on the bill.
    • Cost Effective Date: The date on which the “Cost Per” values became effective. If your "Cost Per" values have been the same since you created your Snowflake account, just pick a date from around the time the account was created.
    • Snowflake Account ID: The value returned from running SELECT LOWER(CURRENT_ACCOUNT()) in your Snowflake account.
    • Snowflake Account Region: The value returned from running SELECT LOWER(CURRENT_REGION()), for now only ’aws_us_east_1’.
  2. Click the Save button.

Create a Share in your Snowflake Account

After clicking save in the previous step, a SQL script will appear in a text box.

  • Copy the SQL script.
  • Paste it into a Snowflake worksheet in your account.
  • Review the Script
  • Select the All Queries Checkbox
  • Click Run to create and share the necessary data with CloudZero

🚧

Go get a coffee!

This script can take a while to run if you haven’t used these billing tables before. Our experience shows that first use can take 3+ hours; however, subsequent uses usually take minutes.

Return to the Connections Page

Refresh the Connections page to see the status of your Snowflake Connection. Once we discover the share created in (Step 3), a Snowflake Connection will appear on the CloudZero Connections page in the Billing Connections table.

CloudZero ConnectionsCloudZero Connections

Once the connection has been verified, the Health column will update from “Pending Data” to “Healthy”. Discovery can take up to an hour. It can take up to a day to synchronize new accounts before you see cost data in the Explorer.

If something changes on your side and CloudZero can no longer use the role that was just granted permissions, the Health will change and provide details on why CloudZero cannot connect.

You can connect any other Snwoflake Accounts you want at this point with the same process.

Connecting Other Cost Sources

Additionally, you may want CloudZero to help with your other AWS or Azure costs, or the custom costs you can bring in using an AnyCost Adaptor.

Start by learning about CloudZero Connections, or choosing a Cost Source from the What's Next section below:


Did this page help you?