Cloud infrastructure can become expensive as systems scale because infrastructure-as-code changes alter the bill. A cost driver is a factor or activity that affects total cloud computing cost. Identify these drivers before changing infrastructure, then use the findings to guide optimization and budget controls. section 12.0 section 12.1
Investigate cost drivers by:
- Breaking the bill down by offering, such as compute, databases, messaging, storage, networking, and other services. section 12.1
- Separating testing and production environments to reveal where inefficiencies or excessive resource footprints occur. section 12.1
- Inspecting resource attributes such as server type and size, then controlling them with policy tests, right-sizing, reservations, or autoscaling. section 12.1 section 12.4
- Repeating the analysis as customer demand, organizational scale, architecture, and provider billing evolve. section 12.0
Estimating a compute cost driver
Parse infrastructure-as-code for servers, group them by region and machine type, retrieve CPU and RAM prices from the Google Cloud Billing Catalog API, and calculate monthly cost. A policy test can multiply the estimate by server count and fail when the total exceeds a budget; adding a server produces an example failure at $4,687.62 against a $4,500 limit. section 12.1.2
Table 12.1 Your cloud bill by offering and the environment (view table figure)
Compare subtotals by offering and environment to locate the largest contributors and prioritize investigation. section 12.1
