[Music] hi everyone i'm erica chong a partner engineer at google cloud welcome back to google cloud technical guides for startups where we're creating a series of videos for technical enablement to help startups set up their own google cloud platform environment and grow their businesses successfully and sustainably on google cloud this episode focuses on setting up billing and alerts and optimizing costs like google cloud which i know is everyone's favorite topic the good news is google cloud makes billing management and optimization really easy in this video we're going to cover google cloud resources billing administration discounting
and additional resources so without any further ado let's get right on into exploring the google cloud platform together if you're new to google cloud please refer to video two of the series which discusses google cloud resources organizations and permissions these concepts will be important when it comes to billing administration a billing admin is responsible for much more than just making sure invoices get paid they're also responsible for managing payment instruments configuring billing exports viewing cost information and managing user roles on the billing account the way cloud computing is charged and billed it's a little the
shift in mindset from what most companies are used to instead of one and done data center purchases billing is done monthly and is consumption based managing costs becomes a little bit different which we'll get into when we discuss budgets and alerts in order to connect a project to a billing account you need to have the correct permissions granted on both the project and billing account levels the minimum roles required include billing account user on the billing account and project billing manager on the project or resource associated higher permissions such as project owner will work as
well but are unnecessary due to lease privilege design while on the topic of permissions it's important to note that when a new billing account is created the user creating it is usually also given the payment profile admin role on the payment profile if you do need to change the billing account admin role to someone else for whatever reason remember to also change the payment profile admin role so what is a billing account specifically a billing account is essentially how you pay for projects projects can exist without a billing account thanks the free tier that many
google products have but you're limited to quotas to fully operate a project must have a billing account associated to it a billing account is just where costs and charges are bucketed and this also represents a customer's legal relationship with google the billing account is then both a legal and financial entity an organization can parent a billing account but the organization and contractual obligation between google and the customer exists at the billing account level there are two types of billing accounts there's invoice or offline and that just refers to accounts that are invoiced on net terms
typically 30 days and have a signed contract associated there's also self-serve or online and that refers to accounts that sign up in a self-service manner with a credit card debit card or bank transfer and are charged when payment becomes due most organizations will have a single billing account but some may have multiple generally if you have multiple it's due to legal or accounting reasons or maybe they need to pay in multiple currencies something to keep in mind is that having multiple billing accounts can mean additional overhead and could make things tricky to track and manage
depending on how many you have so just be cognizant of that before you start setting up multiple a project can only be assigned to one billing account but a billing account can be tied to multiple projects a billing account is managed through the google cloud console a billing account is specific to google cloud resources but there is another resource called a payments profile which i mentioned earlier which is a general google billing resource and applicable for other services such as maps and ads your billing account is linked to your payment profile you can see and
manage everything at pay.google.com this is essentially just a collection of payment information such as mailing addresses and forms of payments for the organization as a whole so let's take a look at what this looks like in the console itself this is the interface of a billing account the billing id is at the top this is automatically generated for you you have your billing admin you can have multiple here this person can add additional admins and users and assign permissions directly on the billing account each project you create will be linked to a billing account and
here you can also see which projects are linked to that particular billing account when you create a new project it will ask you which billing account you'd like to associate you can also suspend a project to stop billing at any time something to keep in mind is that projects and billing accounts do not necessarily need to be in the same organization as long as a user has the correct permissions to set up the relationship between the billing account and a project they could be anywhere so you could manage things cross-organizationally as well so now that
you have your resources and billing accounts set up and running you may be wondering how do i see what resources i'm using and where are my largest costs coming from that's relatively easy and there are a few ways that you can do this so first you have your cloud console billing reports these are going to give you general information on your spend and they're ready to go ready made examples here another option is your monthly invoice this will show you details of consumption associated with a billing account depending on how many resources you've consumed your
bill could be quite lengthy so it might be a lot to sift through another option is to build a customized billing dashboard in bigquery data studio or a bi tool of your choice this will give you more granular reporting analysis and visibility and allow you to really slice and dice your data and derive insights from it so let's take a look at an example of one of these dashboards built in data studio so a data studio dashboard such as this one can give you a more visual view of your building this dashboard has multiple different
views to give you different levels of detail the first is going to be our gcp cost summary we can see we have year-to-date costs quarter-to-date costs month-to-date costs we also see trends month over month change in dollars you can also add visuals such as pie charts to allow you to easily slice and dice your data and see how much of each service is contributing to your overall bill you can also filter based on labels in this particular dashboard we've added granularity on the team google cloud platform service and environment levels so environment could also just
be production and deployment so let's take a look at our costs by teamview so once this loads we can see that we have four different teams and with this we can get granularity pretty easily so very quickly i can see that almost 50 percent of billing is by the pso team 33 is by the engineering team and 16 is by the networking team over on the right hand side we also have a trend analysis to which we can see how our data is moving over a time basis at the top we also have filters so
if i wanted to filter by date range metric project or gcp service those are options as well again slice and dice your data the same views can be seen on an environment basis as well these labels were created on the project level and were included in the queries used to export the data so currently we only have one environment it's production in this case but we can very easily see that we've accrued a cost of 827 dollars and same thing as we saw before we have a graph on the right hand side that shows our
trend analysis this is actually a pre-made template that you can reuse with your own billing export data and there are instructions on how to do so within the bottom tab right here next is managing our monthly spend so we really want to remain on target to see where we are and that's where budgets and alerts come in so alerts are important to avoid any sort of billing surprises and you can set up multiple alert percentages to get notifications as usage continues to increase so for example if i wanted to be notified when i reached 50
75 and 90 of my budget i can do so you can set notifications up in your email or you can set them to automatically take action using pub sub cloud functions or cloud run this could include shutting down a resource or changing resource usage or sending notifications to a ticketing system such as servicenow there's also a forecast trigger so this will allow you to be notified as soon as you are forecasted to reach a budget by the end of the month this allows you to make changes to lower your spend if needed and is a
much more proactive rather than reactive response so as mentioned when i showed that data studio dashboard labels can help you manage cloud applications at scale so they offer clarity into resources being used and can help deploy monitor and manage at an individual application level they can give visibility into usage by department or group and help with cost control and resource management so we all love discounts and optimization and here are just a few ways to do so within your gcp environments so cuts or committed use discounts allow users to pre-buy in bunk committed use discounts
are ideal for workloads with predictable resource needs when you purchase a committed use discount you purchase compute engine resources such as fee cpus memory gpus local ssds and sole tenant nodes at a discounted price in return for committing to paying for those resources for one or three years the discount is up to 57 for most resources like machine types and gpus the discount can also be up to a whopping 70 for memory optimized machine types for cloud sql it's a little bit different you commit to a consistent amount of usage measured in dollars per hour
of equivalent on-demand spend for a one or three year term in exchange you receive a discounted rate on the applicable usage your commitment covers so you can purchase committed use discounts from any cloud billing account and the discount applies to any eligible usage on projects paid for by that billy account any sort of overages are then charged at an on-demand rate there's also sustained use discounts and these are one of gcp's larger points of differentiation so this is basically a large discount on compute engine resources for workloads that are run for a significant portion of
the month there's also preemptable vms and this is another great way to lower costs if you have workloads that are fault tolerant and can withstand possible instance preemptions discounts for these can be up to 80 i suggest talking to your sales team to see how you can optimize your environment and really take advantage of any applicable discounts so with that we have tons of resources and guides around setting up billing on our documentation site i highly encourage you to take a look prior to setting everything up in your own environment should you run into any
issues our billing support team is always available as well a couple of resources have been added to the description box below to help you understand these concepts in further detail so please check them out this brings us to the end of the video where we covered google cloud resources billing admin discounting and additional resources stay tuned for all of the exciting content that we have in store for you and don't forget to like and subscribe on our youtube channel click on the bell icon to be notified each time a new video is posted and we
will see you very soon in our next video thank you [Music] baby