Chapter 5 Billing

In order to use AnVIL, you will need to set up a billing account and add members to it. These sections guide you through that process.


5.1 Create Google Billing Account

  1. Log in to the Google Cloud Platform console using your Google ID. Make sure to use the same Google account ID you use to log into Terra.

  2. If you are a first time user, don’t forget to claim your free credits! If you haven’t been to the console before, once you accept the Terms of Service you will be greeted with an invitation to “Try for Free.”

    Screenshot of the Google Cloud Console with the "Try for Free" button highlighted.

  3. Follow the instructions to sign up for a Billing Account and get your credits.

  4. Choose “Individual Account”. This “billing account” is just for managing billing, so you don’t need to be able to add your team members. You will need to give either a credit card or bank account for security. Don’t worry! You won’t be billed until you explicitly turn on automatic billing.

    Screenshot of the Google Cloud Billing Account Setup, with "Individual Account" highlighted.  Also highlighted is text stating "You won't be charged unless you manually upgrade to a paid account."

  5. You can view and edit your new Billing Account, by selecting “Billing” from the left-hand menu, or going directly to the billing console console.cloud.google.com/billing

    Screenshot of the Google Cloud Console dropdown menu, with "Billing" highlighted.

  6. Clicking on the Billing Account name will allow you to manage the account, including accessing reports, setting alerts, and managing payments and billing.

    Screenshot of the Google Cloud Console Billing Page, with the name of the new billing account highlighted.

At any point, you can create additional Billing Accounts using the Create Account button. We generally recommend creating a new Billing Account for each funding source.

5.2 Add Terra to Google Billing Account

This gives Terra permission to create projects and send charges to the Google Billing Account, and must be done by an administrator of the Google Billing Account.

Terra needs to be added as a “Billing Account User”:

  1. Log in to the Google Cloud Platform console using your Google ID.

  2. Navigate to Billing

    Screenshot of the Google Cloud Console drop-down menu, with "Billing" highlighted.

  3. You may be automatically directed to view a specific Billing Account. If you see information about a single account rather than a list of your Billing Accounts, you can get back to the list by clicking “Manage Billing Accounts” from the drop-down menu.

    Screenshot of an individual Google Cloud Billing Account with the drop-down menu item "Manage Billing Accounts" highlighted.

  4. Check the box next to the Billing Account you wish to add Terra to, click “ADD MEMBER”.

    Screenshot of Google Cloud Billing Accounts Overview. The checkbox next to the name of a Billing Account is checked and highlighted, and the "Add Member" button is highlighted.

  5. Enter terra-billing@terra.bio in the text box. In the drop-down menu, mouse over Billing, then choose “Billing Account User”.

    Screenshot of the dialogue box for adding a member to a Google Cloud Billing Accounts. The text box is highlighted and has been filled in with "terra-billing@terra.bio".  In the drop-down menu labeled "Select a Role", the item "Billing" and the submenu item "Billing Account User" are highlighted.

  6. Click “SAVE”.

    Screenshot of the dialogue box for adding a member to a Google Cloud Billing Accounts. The Save button is highlighted.

5.3 Add Members to Google Billing Account

Anyone you wish to add to the Billing Account will need their own Google ID.

To add a member to a Billing Project:

  1. Log in to the Google Cloud Platform console using your Google ID.

  2. Navigate to Billing

    Screenshot of the Google Cloud Console drop-down menu, with "Billing" highlighted.

  3. You may be automatically directed to view a specific Billing Account. If you see information about a single account rather than a list of your Billing Accounts, you can get back to the list by clicking “Manage Billing Accounts” from the drop-down menu.

    Screenshot of an individual Google Cloud Billing Account with the drop-down menu item "Manage Billing Accounts" highlighted.

  4. Check the box next to the Billing Account you wish to add a member to, click “ADD MEMBER”.

    Screenshot of Google Cloud Billing Accounts Overview. The checkbox next to the name of a Billing Account is checked and highlighted, and the "Add Member" button is highlighted.

  5. Enter their Google ID in the text box. In the drop-down menu, mouse over Billing, then choose the appropriate role.

    Screenshot of the dialogue box for adding a member to a Google Cloud Billing Accounts. In the drop-down menu labeled "Select a Role", the item "Billing" and the submenu item "Billing Account Viewer" are highlighted.

  6. Click “SAVE”.

    Screenshot of the dialogue box for adding a member to a Google Cloud Billing Accounts. The Save button is highlighted.

5.4 Set Alerts for Google Billing

  1. Log in to the Google Cloud Platform console using the Google ID associated with your Google Cloud projects.

  2. Open the dropdown menu on the top left and click on Billing.

    Screenshot of the Google Cloud Console drop-down menu, with "Billing" highlighted.

  3. You may be automatically directed to view a specific Billing Account. If you see information about a single account (and it’s not the one you’re interested in), you can get back to the list of all your Billing Accounts by clicking “Manage Billing Accounts” from the drop-down menu.

    Screenshot of an individual Google Cloud Billing Account with the drop-down menu item "Manage Billing Accounts" highlighted.

  4. Click on the name of the Billing Account you want to set alerts for.

    Screenshot of Google Cloud Billing Accounts Overview. A Billing Account name is highlighted.

  5. In the left-hand menu, click “Budgets & alerts”.

    Screenshot of an individual Google Cloud Billing Account with the left-hand menu item "Budgets & alerts" highlighted.

  6. Click the “Create Budget” tab.

    Screenshot of the budgets and alerts page for a Google Cloud Billing Account. The "Create Budget" button highlighted.

  7. Enter a name for your budget, and then choose which projects you want to monitor. Then click “Next”.

    Screenshot of the form for setting budget scope for a Google Cloud Billing Account. Three things are highlighted:  1) the box for entering a "Name" for the budget, 2) the dropdown menu labeled "Projects" for selecting which Billing Projects are part of the budget, and 3) the "Next" button.

  8. For Budget Type, select “Specified amount”. Enter the total budget amount for the month (you will set alerts at different thresholds in the next step). Click “Next” (do not click “Finish”).

    Screenshot of the form for setting budget amount for a Google Cloud Billing Account.  The drop-down menu labeled "Budget type" is highlighted and "Specified amount" is selected.  Also highlighted are the text box labeled "Target amount" and the "Next" button.

  9. Enter the threshold amounts where you want to receive an alert. We recommend starting with 50% and 90%. You can set other alerts if you prefer.

    Screenshot of the form for setting budget actions for a Google Cloud Billing Account.  The boxes for entering "Percent of budget" or "Amount" are highlighted.  The drop-down menu labeled "Trigger on" is highlighted and "Actual" is selected.

  10. Check the box for “Email alerts to billing admins and users”, then click “Finish”. Now you (as the owner and admin), along with anyone you added with admin or user privileges (e.g. lab managers) will receive alerts when your lab members reach the specified spending thresholds. These emails will be sent to the Gmail accounts associated with the Billing Account.

    Screenshot of the form for setting budget alerts for a Google Cloud Billing Account.  The checkbox labeled "Email alerts to billing admins and users" is highligheted and checked.  The "Finish" button is highlighted.

  11. You can edit your budgets at any time by going to Billing > Budgets & alerts, and clicking on the name of the budget you want to edit.

    Screenshot of the Google Cloud Billing Account Budgets and alerts overview.  Four items are highlighted illustrating how to view and edit an existing budget: 1) The top-left "hamburger" button for extending the drop-down menu, 2) the drop-down menu item "Billing", 3) the submenu item "Budgets & alerts, 4) the name of a budget.

5.5 View Spend for Google Billing

You can always check your current spend through the Google Billing console, but remember

  • There is a reporting delay (~1 day), so you cannot immediately see what an analysis cost
  • Costs are reported at the level of Workspaces, so if there are multiple people using a Workspace, you will not be able to determine which of them was responsible for the charges.

The Google Billing console displays information by Billing Account. To view spending:

  1. Log in to the Google Cloud Platform console using the Google ID associated with your Google Cloud projects.

  2. Open the dropdown menu on the top left and click on Billing.

    Screenshot of the Google Cloud Console drop-down menu, with "Billing" highlighted.

  3. You may be automatically directed to view a specific Billing Account. If you see information about a single account (and it’s not the one you’re interested in), you can get back to the list of all your Billing Accounts by clicking “Manage Billing Accounts” from the drop-down menu.

    Screenshot of an individual Google Cloud Billing Account with the drop-down menu item "Manage Billing Accounts" highlighted.

  4. Click on the name of the Billing Account for the project you want to view.

    Screenshot of Google Cloud Billing Accounts Overview. A Billing Account name is highlighted.

  5. Look at the top of the Overview tab to see your month-to-date spending.

    Screenshot of a Google Cloud Billing Account Overview.

  6. Scroll further down the Overview tab to show your top projects.

    Screenshot of a Google Cloud Billing Account top projects.

  7. Click on the Reports tab to see more detailed information about each of your projects. This is probably the most useful tab for exploring costs of individual projects over time.

    Screenshot of a Google Cloud Billing Account Reports tab.

  8. Click on the Cost table tab to obtain a convenient table of spending per project.

    Screenshot of a Google Cloud Billing Account Cost table tab.

5.6 Create Terra Billing Project

  1. Launch Terra and sign in with your Google account. If this is your first time logging in to Terra, you will need to accept the Terms of Service.

  2. In the drop-down menu on the left, navigate to “Billing”. Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click “Billing”. You can also navigate there directly with this link: https://anvil.terra.bio/#billing

    Screenshot of the Terra drop-down menu.  Three items are highlighted: 1) the "hamburger" button for extending the drop-down menu, 2) the arrow next to your username, for extending the drop-down submenu, and 3) the submenu item "Billing".

  3. On the Billing page, click the “+ CREATE” button to create a new Billing Project. Select GCP Billing Project (Google’s Platform). If prompted, select the Google account to use and give Terra permission to manage Google Cloud Platform billing accounts.

    Screenshot of the Terra Billing Page.  The "plus" button next to "Billing Projects" is highlighted.

  4. Enter a unique name for your Terra Billing Project and select the appropriate Google Billing Account. The name of the Terra Billing Project must:

    • Only contain lowercase letters, numbers and hyphens
    • Start with a lowercase letter
    • Not end with a hyphen
    • Be between 6 and 30 characters

    Screenshot of the Terra Add Billing Project dialog box.

  5. Select the Google Billing Account to use. All activities conducted under your new Terra Billing Project will charge to this Google Billing Account. If prompted, give Terra permission to manage Google Cloud Platform billing accounts.

    Screenshot of the Terra Add Billing Project dialog box.  The dropdown menu labeled "Select billing account" is highlighted.

  6. Click “Create”.

    Screenshot of the Terra Add Billing Project dialog box.  The button labeled "CREATE BILLING PROJECT" is highlighted.

  7. Your new Billing Project should now show up in the list of Billing Projects Owned by You. You can add additional members or can modify or deactivate the Billing Project at any time by clicking on its name in this list.

    Screenshot of the Terra Billing Projects menu.  The submenu "Owned by you" is highlighted and has been expanded, showing a list of Billing Projects below.  One of the Billing Project names is highlighted.

The page doesn’t always update as soon as the Billing Project is created. If it’s been a couple of minutes and you don’t see a change, try refreshing the page.

5.7 Add Member to Terra Billing Project

  1. Launch Terra and sign in with your Google account.

  2. In the drop-down menu on the left, navigate to “Billing”. Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click “Billing”. You can also navigate there directly with this link: https://anvil.terra.bio/#billing

    Screenshot of the Terra drop-down menu.  Three items are highlighted: 1) the "hamburger" button for extending the drop-down menu, 2) the arrow next to your username, for extending the drop-down submenu, and 3) the submenu item "Billing".

  3. Click “Owned by You” and find the Billing Project. If you do not see the Billing Project in this list, then you are not an Owner and do not have permission to add members.

    Screenshot of the Terra Billing Projects menu.  The submenu "Owned by you" is highlighted and has been expanded, showing a list of Billing Projects below.

  4. Click on the name of the Billing Project.

    Screenshot of the Terra Billing Projects menu.  The submenu has been expanded, and the name of one of the Billing Projects is highlighted.

  5. Click on the “Members” tab to view and manage members. Then click the “Add User” button.

    Screenshot of a Terra Billing Project management page.  The tab labeled "Members" is highlighed and has been selected, and the button labeled "Add User" is highlighted.

  6. Enter the email address of the user or group you’d like to add the the Billing Project.

    • If adding an individual, make sure to enter the account that they use to access AnVIL.
    • If adding a Terra Group, use the Group email address, which can be found on the Terra Group management page.

    Screenshot of the dialog box for adding users to a Terra Billing Project.  The textbox labeled "User email" is highlighed and has been filled in.

  7. If this user or group will need to add and remove other users of the Billing Project, check the Owner box. Otherwise leave it unchecked.

    • It’s often a good idea to have at least one other Owner of a Billing Project in order to avoid getting locked out, in case the original owner leaves or loses access to their account.

    Screenshot of the dialog box for adding users to a Terra Billing Project.  The checkbox labeled "Can manage users (Owner)" is highlighed.

  8. Click “ADD USER”.

    Screenshot of the dialog box for adding users to a Terra Billing Project.  The button labeled "ADD USER" is highlighed.

  9. You should now see the user or group listed in the Billing Project members, along with the appropriate role. They should now be able to use the Billing Project to fund work on AnVIL.

    Screenshot of a Terra Billing Project member management page.  A user email and role are highlighted.

If you need to remove members or modify their roles, you can do so at any time by clicking the teardrop button next to their name.

Screenshot of a Terra Billing Project member management page.  The teardrop button for one user is highlighted.

5.8 Disable Terra Billing Project

By default this module includes a warning to make sure people understand they will lose access to their Workspace buckets. You can remove the warning from this module by setting AnVIL_module_settings$warning to FALSE before running cow::borrow_chapter:

AnVIL_module_settings <- list(
  warning = FALSE
)
cow::borrow_chapter(
  doc_path = "child/_child_terra_billing_project_disable.Rmd",
  repo_name = "jhudsl/AnVIL_Template"
)

Disabling a Billing Project makes Workspace contents inaccessible!

Disabling a Billing Project disables funding to all Workspaces funded by the Billing Project. You will be unable to compute in these Workspaces, and you will lose access to any data stored in the Workspace buckets. It is sometimes possible to restore access by reactivating billing, but Google makes no promises about whether or how long the data will be recoverable.

Make sure everyone with Workspaces funded by the Billing Project has saved anything they want to keep in another location before disabling the Billing Project.

To disable a Terra Billing Project (i.e. remove the Google Billing Account that funds the Terra Billing Project):

  1. Launch Terra and sign in with your Google account.

  2. In the drop-down menu on the left, navigate to “Billing”. Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click “Billing”. You can also navigate there directly with this link: https://anvil.terra.bio/#billing

    Screenshot of the Terra drop-down menu.  Three items are highlighted: 1) the "hamburger" button for extending the drop-down menu, 2) the arrow next to your username, for extending the drop-down submenu, and 3) the submenu item "Billing".

  3. Click “Owned by You” and find the Billing Project. If you do not see the Billing Project in this list, then you are not an Owner and do not have permission to add members.

    Screenshot of the Terra Billing Projects menu.  The submenu "Owned by you" is highlighted and has been expanded, showing a list of Billing Projects below.

  4. Click on the name of the Billing Project.

    Screenshot of the Terra Billing Projects menu.  The submenu has been expanded, and the name of one of the Billing Projects is highlighted.

  5. If you don’t see information about the Billing Account, click on “View billing account” to expand the Billing Account information. You may be prompted to enter your login information again.

    Screenshot of a Terra Billing Project management page.  The button labeled "view billing account" is highlighted.

  6. You should see the name of the Google Billing Account that is funding this Terra Billing Project. Click on the teardrop icon next to the name of the Billing Account.

    Screenshot of a Terra Billing Project management page.  The teardrop button next to the name of the Billing Account is highlighted.

  7. Click “Remove Billing Account”.

    Screenshot of a Terra Billing Project management page.  The teardrop button next to the name of the Billing Account is highlighted.

  8. Click OK to confirm that you want to disable funding for this Billing Project.

    Screenshot of the dialoge box confirming removal of the Billing Account from a Terra Billing Project.  The button labeled "OK" is highlighted.

  9. The page should now indicate that there is no linked billing account.

    Screenshot of a Terra Billing Project management page.  The Billing Account information which says "No linked billing account" is highlighted.

If necessary, you can restore funding to the Billing Project and associated Workspaces by clicking the teardrop icon and selecting “Change Billing Account”. However, Google makes no promises about how long the Workspace contents will remain available after you disable funding, so it is best not to rely on them.

Screenshot of a Terra Billing Project management page.  The teardrop button next to the Billing Account information is highlighted.