Billing Resources
Resource Management
Billing resources are the fundamental components that make up all billing objects in your cloud environment. Billing resources can be billing accounts, projects, or groups. Groups are simply a collection of projects, billing accounts, and/or even other groups. Resource grouping allows you to organize your resources into collections that are meaningful to you and meet your requirements for how you need to manage and control your cloud costs. Groups can represent departments, cost centers, teams, or even entire organizations.
Currently, OnSpend supports five types of billing resources:
- Billing Accounts: A billing object that is used to pay for your cloud resource usage. In order to have unlimited access to the Google Cloud services, you must have projects linked to an open billing account. Without a billing account, you will not be able to use Google Cloud services that are not free.
- Projects: A project is the basis for using all Google Cloud services. It is the base-level organizing entity. Projects organize of all of your cloud resources and services (i.e storage buckets, virtual machines, databases, containers etc.) into a single billable entity. You can have one or more projects that can have different settings, permissions, and other metadata.
- Groups: A resource group is a collection of billing accounts, projects, or other groups. Groups allow you to create your own custom hierarchy of all of your billing resources. For example, you may have a single billing account, but need to manage and track your cloud costs by department. You could create a department group and assign specific projects to the group to better visualize, budget, forecast, and be alerted of billing events by department.
- Organization: An organization represents the root node in the Google Cloud resource hierarchy. The organization resource is the hierarchical ancestor of projects and folders.
- Folders: A folder is an additional grouping mechanism for projects. The folder resource represents a node in the Google Cloud resource hierarchy. Folders can contain projects or other folders.
- Customer: A customer of a Google reseller account. All services billed by a Google reseller relate to a customer resource. Customer's using Google Cloud services will include all billing accounts billed by the reseller account.
All users by default are provided their own space to organize billing resources as they wish. This space is called the "Root". Each user has their own "root" group, which is named with their email address. Each user has one and only one "root" group that they own and manage. Users can perform all functions on the "root" group with exception of renaming the group or sharing with other users. When a billing resource is shared with a user, it is automatically added to the shared user's "root" group. You can view which billing resources are in your root group by navigating to the Groups view.
The following diagram represents an organization that wanted to manage and track costs by department, yet receive a single invoice for all of their cloud usage. At the top level is a resource group that represents all cloud resources across the entire organization. They then wanted to be able to organize their projects into departments in order to manage and budget their cloud costs by department. The projects were then organized into resource groups and assigned to each department accordingly. Lastly, the organization wanted a single invoice for all of their cloud usage, so a single billing account was created and all of the projects were linked to the billing account.
Creating Resources
If Onix is your premier cloud partner, all of your billing accounts and projects are automatically added to OnSpend. If you create new projects in the Google Cloud Console and link the projects to a billing account that Onix setup for you, the projects will automatically be added to OnSpend within a few hours.
Note: Since projects are the base-level billing entity for Google services, projects must be created with billing enabled through the Google Cloud Console.
If Onix is not your premier cloud partner, please follow the Getting Started Guide to add your own billing accounts to OnSpend.
To create a new billing resource, complete the following steps.
- Navigate to the Groups view.
- Click New.
- Click Add New Group. If you would like to setup a new billing account, click Add New Account and follow the steps in the Getting Started Guide. Click Add New Organization to mirror your Google Cloud organization and resource hierarchy in OnSpend. Please refer to Organization Sync for instructions on setting up an organization resource.
- Provide a name for your group. Give it a name that is meaningful to you and represents the resources that will be contained within the group.
- You can optionally assign project labels to the group to automatically add new projects with these labels to the group. See assigning labels to learn more.
- Click Save.
Note: You must have edit access to the parent billing resource to create a new resource inside of it. You can only create new resources inside of other groups or your "root". You are unable to create new resources within billing accounts or projects.
Renaming Resources
To rename a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to rename.
- Click the icon, and select Rename.
- Provide a new name for the resource.
- Click Save.
Note: You must have edit access to the resource to rename it.
Assigning Labels
You can assign labels to a resource group to automatically organize new projects. OnSpend evaluates the labels applied to a cloud project to automatically assign it to the appropriate group. To learn how to apply labels to your cloud projects, please refer to Google's documentation on Creating and Managing Labels.
To assign labels to a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource group for which you would like to assign labels.
- Click the icon, and select Assign Labels.
- Click Add Label to add a new label.
- Provide a label key and an optional label value.
- Click Save.
Note: You must be the owner of the resource group and have access to the project for group assignment to be applied properly. Group assignment will be applied if a project contains any of the group assigned labels.
Moving Resources
Moving billing resources is an easy and convenient way of organizing your billing resources into groups to better manage your costs.
To move a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to move.
- Click the icon, and select Move.
- Choose a group, then click Move Here.
Note: You must have edit access in both the origin and the destination in order to move resources.
Adding/Removing Resources
OnSpend allows you to add a billing resource to multiple groups. This allows you to build relationships with multiple different billing resources.
To add a billing resource to a group, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to add to another group.
- Click the icon, and select Add to....
- Choose a group, then click Add Here.
For conveinience, you can select multiple resources at one time by hold the ctrl
key and selecting each resource you would like to add to another group. When using this method, click the icon at the top-right of the Groups view.
Note: You must have edit access in the destination resource in order to add resources.
To remove a billing resource from a group, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to remove from a group.
- Click the icon, and select Remove from Group.
Removing a resource from a group only breaks the relationship between the resource and the group. This does not remove it permanently, so it can still be discovered by searching for the resource through the Groups view. To permanently delete a resource, please see Deleting Resources.
Note: You must have edit access in the group in which the resource is being removed.
Deleting Resources
To permanenly delete a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to remove from a group.
- Click the icon, and select Delete.
- You will be prompted to confirm the deletion of the resource.
- Click Delete.
Note: You must be the owner of a resource in order to delete it.
Organization Sync
OnSpend allows you to connect your Google Cloud organization to mirror all projects and folders. To learn more about Google Cloud organizations and resource hierarchy, please refer to Google Resource Hierarchy.
In order to connect a GCP organization to OnSpend, you must be an administrator of the organization. The new organization setup will prompt a selection of an organization. Once an organization is selected, a preview of all the files and folders in the organization will be displayed. Click Confirm to continue with your selection. The organization name and ID will be auto-populated. Click Save.
Since the organization resource does not maintain any billing relationship between resources, OnSpend may not have access to cost and usage data for all projects in the organization. If this is the case, you will be required to add new billing accounts to OnSpend.
The initial organization sync may take up to 10 minutes. Once the organization setup has completed, you will receive an email confirmation which contains more details about the connection to your organization. If OnSpend does not have access to cost and usage data to all projects in your organization, the email will include a list of project IDs and billing account IDs that will need to be set up individually.
Resource Synchronization
OnSpend automatically keeps all of your billing accounts and projects in sync with your cloud provider on a regular basis. The resource sync process will also automatically add new projects and organize them into resource groups if you have applied label assignments. If the organization sync has been configured, OnSpend will also automatically sync the organization resources, including all projects and folders.
Note: Resource synchronization runs every few hours. If you have made a change to a billing account or project in your cloud provider console, it may take up to 4 hours before those changes will be reflected in OnSpend.
Billing accounts related to a customer resource are also automatically grouped under the customer resource. These are determined by the presence of any active GCP subscriptions associated with the customer account. The customer synchronization process runs once daily.
Sharing Resources
OnSpend makes it easy to share billing and usage data with other users. When a billing resource is shared with another user, they are granted access to that resource and any other resources contained within it.
There is no limit to the number of users you can share with, so feel free to share with users at any level of your organization.
Start Sharing
To share a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to share.
- Click the icon, and select Share.
- The sharing dialog will open and show who currently has access to the resource.
- Enter the email address or addresses of the user(s) you wish to share with.
- Select a role for the user(s). Please see Roles & Permissions to learn the difference between viewers and editors. By default, Can Edit is selected.
- By default users will be notified when a billing resource is shared with them. You can add a message if you wish, or disable the notification to these users.
- If sharing an ACCOUNT resource, you can optionally update the Google Cloud IAM policy of the billing account. This option is only available if the authenticated user has the Billing Account Administrator role and has access to share the account with others through the GCP console.
- Click Save.
For conveinience, you can select multiple resources to share at one time by holding the ctrl
key and selecting each resource you would like to share. When using this method, click the icon at the top-right of the Groups view.
Note: You must have edit access to share a billing resource. Currently, you can only share with other users. Groups are currently not supported by OnSpend.
If updating the IAM policy of a billing account, only the following roles can be applied when sharing: Billing Account Administrator, Billing Account User, Billing Account Viewer.
Stop Sharing
To unshare a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to share.
- Click the icon, and select Share.
- The sharing dialog will open and show who currently has access to the resource.
- Click the icon next to the user you wish to unshare the resource with.
Note: You must have edit access to stop sharing a billing resource.
Change Sharing
To change sharing settings on a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to share.
- Click the icon, and select Share.
- The sharing dialog will open and show who currently has access to the resource.
- Select a new role next to the user for which you wish to change the level of access.
- Click Save.
Note: You must have edit access to change sharing settings on a billing resource.
Transfer Ownership
Each resource has one and only one owner. Typically the owner is the user who created the resource, however, ownership can be assigned by another owner of a resource or an OnSpend administrator. Owners have all of the same privileges as editors, but can transfer ownership and permanently delete resources for which they own.
To transfer ownership of a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to share.
- Click the icon, and select Share.
- The sharing dialog will open and show who currently has access to the resource.
- Open the role selector and select Is Owner next to the user you wish to transfer ownership to.
- Click Save.
Note: You must be the owner of a resource to transfer ownership.
Watching Resources
In order to effectively monitor events on your billing resources, OnSpend allows users to "watch" resources. By watching a resource, you sign up to receive email notifications pertaining to the watched resource and any of its descendants.
Currently, OnSpend delivers notifications for the following events:
- New projects linked to a billing account
- Projects that have been deleted from the Google Cloud Console
- Projects that have had billing disabled
- Projects that have changed billing accounts
- Custom budget expirations
- Invoice has been created for a billing account
- Budget milestones have been reached
- Unexpected increase in spend on a billing account
Start Watching
When you start watching a resource, you will begin receiving notifications related to the selected resource and any of the resources contained within it.
To start watching a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to watch.
- Click the icon, and select Watch.
By default, you will be automatically subscribed to receive notifications for all the events listed above. You can optionally unsubscribe from specific notifications if you wish to only receive alerts for certain types of events.
To subscribe or unsubscribe from watched events, complete the following steps.
- Navigate to the User Settings view.
- In the Watched Resources section, identify the watched resource for which you would like to change notification settings.
- Toggle on or off the event for which you would like to start or stop receiving notifications.
Note: You must be subscribed to at least one event per watched resource. If you would like to unsubscribe from all events, you will be prompted to stop watching the resource.
Stop Watching
When you stop watching a resource, you will no longer receive notifications related to the selected resource, nor any of the resources contained within it.
To stop watching a billing resource, complete the following steps.
- Navigate to the Groups view.
- Search or navigate to the resource you would like to stop watching.
- Click the icon, and select Unwatch.
Programmatic Notifications
If you need your watched events to trigger automated processes or integrate into your other applications, OnSpend can deliver watched event notifications to a Pub/Sub topic, Google Chat room, Slack channel, or Text (SMS) message with the details of the event. To learn more about automated message delivery using Pub/Sub, please refer to Google's documentation on Cloud Pub/Sub.
Pub/Sub Notifications
To configure programmatic notifications with Pub/Sub, complete the following steps.
If necessary, create a Cloud Pub/Sub topic in the Google Cloud Console for OnSpend to publish your watched events to. This is required before proceeding to the following steps.
- Navigate to user settings.
- If you do not have any watched resources in the list of watched resources, you'll need to start watching a resource to continue.
- Click the icon to add a notification channel.
- Select Pub/Sub.
- Select a project.
- Select a topic.
- Click Save.
Note: You must be a project owner of the project containing the Pub/Sub topic.
Event Message Format
Watched events sent to the Cloud Pub/Sub topic consists of a set of attributes describing the specific event. Attributes are key-value pairs contained in the notification delivered by OnSpend to your Cloud Pub/Sub topic. Messages delivered by OnSpend contain the following set of key-value pairs.
Attribute Name | Description | Example |
---|---|---|
channelId | The identifier of the notification channel. This is read-only and provided when a notification channel is created. | 3243228756905 |
eventType | The type of event. Possible values are BUDGET, INVOICE, or RESOURCE. | BUDGET |
eventName | The name of the event. For BUDGET events, possible values are EXPIRATION or MILESTONE. For RESOURCE events, possible values are ANOMALY, CREATE or ACCOUNT_CHANGE. For INVOICE events, possible values are CREATE. | EXPIRATION |
id | The unique OnSpend ID of the billing resource for which the event occurred. | 13423430000 |
resourceId | The cloud provider ID (GCP) of the resource for which the event occurred. This will be empty for GROUP resource types. | 01D4EE-079462-DFD6EC |
resourceName | The name of the resource in OnSpend. | My Biling Account |
resourceProvider | The cloud provider of the resource for which the event occurred. Possible values are GCP or empty if the resource type is GROUP. | GCP |
resourceType | The type of resource. Possible values are PROJECT, ACCOUNT, GROUP, or ROOT. | ACCOUNT |
resourceLink | The link to the resource in OnSpend. | https://onspend.onixnet.com |
sourceId/destinationId | The unique OnSpend ID of the source or destination resource. This field is only provided with ACCOUNT_CHANGE and CREATE events. | 13423430000 |
sourceResourceId/destinationResourceId | The cloud provider ID of the source or destination resource. This field is only provided with ACCOUNT_CHANGE and CREATE events. | 01D4EE-079462-DFD6EC |
sourceResourceName/destinationResourceName | The name of the source or destination resource in OnSpend. This field is only provided with ACCOUNT_CHANGE and CREATE events. | My Biling Account |
expiresIn | The number of days until a resource budget will expire. This field is only provided with EXPIRATION events. | 10 |
expirationDate | The date at which a resource budget will expire. Date is formatted in yyyy-MM-dd. This field is only provided with EXPIRATION events. | 2019-08-31 |
budgetId | The unique ID of the OnSpend budget. This field is only provided with BUDGET MILESTONE events. | 4243200920 |
budgetName | The name of the OnSpend budget. This field is only provided with BUDGET MILESTONE events. | My Monthly Budget |
milestoneId | The unique ID of the budget milestone. This field is only provided with BUDGET MILESTONE events. | 322321872 |
milestoneName | The name of the budget milestone. This field is only provided with BUDGET MILESTONE events. | Phase 1 Milestone |
milestoneType | The type of milestone. Possible values are COST or DATE. This field is only provided with BUDGET MILESTONE events. | COST |
milestoneAmount | For COST milestones, the cost threshold defined on the milestone. For DATE milestones, the cost at the time the milestone was reached. This field is only provided with BUDGET MILESTONE events. | 1250.75 |
milestonePercent | For COST milestones, the percentage of budget threshold defined for the milestone. For DATE milestones, the percentage of the budget consumed at the time the milestone was reached. This field is only provided with BUDGET MILESTONE events. | 50.5 |
milestoneDate | For COST milestones, the date and time the milestone was reached. For DATE milestones, the date threshold defined for the milestone. This field is only provided with BUDGET MILESTONE events. Date is formatted in yyyy-MM-dd hh:mm a Z | 2020-08-19 12:00 AM EDT |
invoiceDate | The month and year of the invoice created. Date is formatted in yyyy-MM. This field is only provided with INVOICE CREATE events. | 2020-07 |
invoiceId | The unique ID of the invoice created. This field is only provided with INVOICE CREATE events. | 1 |
totalCost | The total cost/amount due of the invoice created. This field is only provided with INVOICE CREATE events. | 50.00 |
percentChange | The percentage change +/- from the previous invoice. This field is only provided with INVOICE CREATE events. | 15.00 |
costDifference | The dollar amount change +/- from the previous invoice. This field is only provided with INVOICE CREATE events. | 125.50 |
invoiceLink | The unique link to the invoice page in OnSpend. This field is only provided with INVOICE CREATE events. | https://onspend.onixnet.com/invoice/[invoiceId] |
anomalyDate | The date at which a cost anomaly was detected. The date is formatted in yyyy-MM-dd. This field is only provied with ANOMALY events. | 2020-10-01 |
Sample Pub/Sub Message
{
"message": {
"data": "",
"attributes": {
"eventType": "BUDGET",
"eventName": "EXPIRATION",
"id": "13423430000",
"resourceId": "01D4EE-079462-DFD6EC",
"resourceName": "My Billing Account",
"resourceType": "ACCOUNT",
"resourceProvider": "GCP",
"resourceLink": "https://onspend.onixnet.com",
"channelId": "3243228756905",
"expiresIn": "10",
"expirationDate": "2019-08-31"
},
"messageId": "4328423413412341",
"publishTime": "2019-08-15T23:16:42.302Z"
}
}
Google Chat Notifications
To configure notifications with Google Chat, complete the following steps.
Note: Your organization must have Google Chat enabled for you to connect OnSpend to a Chat Room and you must enable webhooks on your Chat Rooms.
- Go to Google Chat.
- Select or create a room that you would like to receive OnSpend notifications.
- Click the Chat Room name from the top of the Chat Room page.
- Select Configure webhooks.
- In the name field, enter: OnSpend.
- In the avatar URL field, enter: https://onspend.onixnet.com/assets/images/onspend-avatar.png.
- Click Save.
- Copy the webhook URL by clicking the icon.
- Navigate to user settings.
- If you do not have any watched resources in the list of watched resources, you'll need to start watching a resource to continue.
- Click the icon to add a notification channel.
- Select Google Chat.
- Paste the webhook URL from step 8 into the Webhook Url field.
- Click Save.
- You should receive a confirmation message posted to your Chat Room.
Slack Notifications
To configure notifications with Slack, complete the following steps.
- Navigate to user settings.
- If you do not have any watched resources in the list of watched resources, you'll need to start watching a resource to continue.
- Click the icon to add a notification channel.
- Select Slack.
- Sign in to your Slack workspace and select a channel to post to.
- Click Allow.
- OnSpend will automatically populate the Workspace and Channel fields.
- Click Save.
- You should receive a confirmation message posted to your Slack Channel.
SMS Actions
To configure notifications with SMS, complete the following steps.
- Navigate to user settings.
- If you do not have any watched resources in the list of watched resources, you'll need to start watching a resource to continue.
- Click the icon to add a notification channel.
- Select SMS.
- Enter your 10-digit phone number.
- If your phone number has not yet been verified, you will be required to verify your phone number. Click Send verification code to receive a 6-digit code you must use to verify ownership of the phone number.
- Once you receive the 6-digit verification code, enter it into the Verification Code field.
- Click Save.