Work with the account budget¶
The account budget monitors spending for all credit usage in the account.
Activating the account budget¶
To start using budgets to monitor credit usage for your account, activate the account budget. After you activate the account budget, you can set the spending limit for the account and configure how notifications are sent when credit usage is expected to exceed the spending limit. Notifications begin when projected spending is more than 10% above the spending limit.
You can activate the account budget by using Snowsight or by executing SQL statements.
The next sections explain how to activate the account budget:
Create a custom role to manage the account budget¶
You can create a custom role to activate and modify the account budget. A user who is granted this role can administer the budget by taking the following actions on the account budget:
Activate and deactivate the account budget.
Set the spending limit.
Edit notification settings.
Monitor credit usage for the account.
For a full list of roles and privileges required for the budget administrator role, see Budgets roles and privileges.
The following example creates a role named account_budget_admin
and grants the role the ability to monitor and manage the
account budget:
USE ROLE ACCOUNTADMIN;
CREATE ROLE account_budget_admin;
GRANT APPLICATION ROLE SNOWFLAKE.BUDGET_ADMIN TO ROLE account_budget_admin;
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE account_budget_admin;
Use Snowsight to activate the account budget¶
Note
Only a user with the ACCOUNTADMIN role or a role granted account budget admin privileges can activate and set up the account budget.
Sign in to Snowsight.
Select Admin » Cost Management.
Select Budgets.
If prompted, select a warehouse.
In the dashboard, select Set up Account Budget.
Enter the target spending limit for the account.
Enter the email addresses to receive notification emails.
Note
Each email address added for budget notifications must be verified. The notification email setup fails if any email address in the list is not verified.
Select Finish Setup.
Use SQL commands to activate the account budget¶
Note
Only a user with the ACCOUNTADMIN role or a role granted account budget admin privileges can activate and set up the account budget.
Activate the account budget by calling the account_root_budget!ACTIVATE method on the SNOWFLAKE.LOCAL.ACCOUNT_ROOT_BUDGET object:
CALL SNOWFLAKE.LOCAL.ACCOUNT_ROOT_BUDGET!ACTIVATE();
Set the spending limit calling the <budget_name>!SET_SPENDING_LIMIT method:
CALL SNOWFLAKE.LOCAL.ACCOUNT_ROOT_BUDGET!SET_SPENDING_LIMIT(1000);
Set up notifications for the budget so that you receive notifications when your credit usage is expected to exceed your spending limits.
Deactivating the account budget¶
You can deactivate the account budget using Snowsight or SQL.
Deactivating the account budget resets the account budget to its state before activation:
All historical account budget data is deleted.
The background measurement task for the account budget is suspended.
The account budget settings for spending limit and email notifications are reset.
Account budget deactivation does not affect custom budgets. To remove a custom budget from your account, use the DROP BUDGET command.
Note
If the account budget is deactivated, you can’t create new custom budgets using Snowsight. However, you can continue to create custom budgets using SQL.
Use Snowsight to deactivate the account budget¶
You can deactivate the account budget using the Budgets page:
Use SQL commands to deactivate the account budget¶
You can use the account_root_budget!DEACTIVATE method to deactivate the account budget:
CALL SNOWFLAKE.LOCAL.ACCOUNT_ROOT_BUDGET!DEACTIVATE();