Giter Site home page Giter Site logo

cyclenerd / google-cloud-pricing-cost-calculator Goto Github PK

View Code? Open in Web Editor NEW
120.0 6.0 17.0 12.01 MB

๐Ÿ’ธ Calculate estimated monthly costs of Google Cloud Platform products and resources via YAML files and CLI program (Linux, macOS, Windows)

Home Page: https://gcloud-compute.com/gcosts.html

License: Apache License 2.0

Perl 41.03% Shell 14.29% Go 43.26% Makefile 1.42%
gcp google-cloud google-cloud-platform infrastructure-as-code infrastructure usage billing invoice compute-engine google-compute-engine

google-cloud-pricing-cost-calculator's Introduction

Google Cloud Platform Pricing and Cost Calculator

Badge: Google Cloud Badge: Linux Badge: macOS Badge: Windows Badge: Go Go Report Card Badge: CI Badge: GitHub Badge: Downloads

๐Ÿ† Awarded
This project was the winner of the Google Open Source Peer Bonus in 2022 ๐Ÿฅณ

Calculate estimated monthly costs of Google Cloud Platform products and resources. Optimized for DevOps, architects and engineers to quickly see a cost breakdown and compare different options upfront:

  • Mapping of resource usage is done in easy to learn YAML usage files
  • Price information is read from a local file (pricing.yml)
  • Calculation is done via gcosts CLI program
  • Calculated costs are saved in CSV file optimized for non-technical audience

Full control and no disclosure of any information and costs to third parties. Everything is calculated on your local computer. No need to have a connection to the Internet. Everything tested and matched against the actual invoice in large Google Cloud migration projects. Over 360 automated tests ensure gcosts reliability. gcosts works on various OS and terminals, including Windows CMD, macOS iTerm2, and in CI systems like GitHub Actions.

1๏ธโƒฃ Create YAML file 2๏ธโƒฃ Run gcosts CLI program 3๏ธโƒฃ Open CSV file
Screenshot: YAML usage file Screenshot: gcosts CLI program Screenshot: CSV file

โ˜๏ธ Supported resources

The cost of a resource is calculated by multiplying its price by its usage.

๐Ÿ’ก Google Cloud Free Program
Free tiers and free trial (90-day, $300), which are usually not a significant part of cloud costs, are ignored. For example: 1x free non-preemptible e2-micro VM instance per month, free NAT for 32 VMs, 30 GB-months standard persistent disk, 1 GB network egress and everything else are not taken into account.

Resources that gcosts supports, and Google charges for:

๐Ÿ–ฅ๏ธ Compute Engine Instances
  • All machine types are supported
    • A2 and G2 accelerator optimized machines
    • C2, C2D and H3 compute optimized machine series
    • M1, M2 and M3 memory optimized machine series
    • C3, E2, N1, N2, N4, N2D, T2D and T2A general purpose machine series
  • Sustained use discounts (SUD) are applied to monthly costs
  • Spot provisioning model (Spot VM) is supported
  • Flexible committed use discounts (Flexible CUD) are not supported
  • 1 year and 3 year committed use discounts (CUD) are supported
  • Paid "premium" operating system licenses (paid images) are supported
    • SUSE Linux Enterprise Server
    • SLES for SAP (1y and 3y committed use discounts (CUD) are also supported)
    • Red Hat Enterprise Linux (1y and 3y committed use discounts (CUD) are also supported)
    • RHEL for SAP (1y and 3y committed use discounts (CUD) are also supported)
    • Windows Server
  • Custom machine types are supported (have to be created manually)
  • Sole-tenant VMs are not supported
๐Ÿ’พ Compute Engine Disks
  • All persistent disk (PD) types are supported
    • Zonal persistent disk
    • Regional persistent disk
    • Local SSD
    • Provisioned IOPS
๐Ÿชฃ Cloud Storage
  • All storage classes and location types are supported
    • region
    • dual-region
    • multi-region
  • Retrieval fees are calulated
๐Ÿš‡ Hybrid Connectivity
  • VPN tunnel
  • Interconnect is currently not calculated
๐Ÿ”— Cloud NAT
  • NAT gateway
  • Data processing (both egress and ingress)
๐Ÿšฆ Cloud Monitoring (Operations Suite)
  • Monitoring data
๐Ÿ•ธ๏ธ Network
  • Premium Tier internet egress
    • Worldwide destinations (excluding China & Australia, but including Hong Kong)
    • China destinations (excluding Hong Kong)
    • Australia destinations
๐Ÿ—๏ธ TODO

The following services are not currently supported, but are on the TODO list:

  • BigQuery
  • Cloud SQL

Please suggest other resources worth covering by upvoting existing issue or opening new issue.

๐Ÿง‘โ€๐Ÿซ Start the interactive tutorial

This guide is available as an interactive Cloud Shell tutorial. To get started, please click the following button:

Open in Cloud Shell

๐Ÿƒ Quick start

1. Get gcosts program

Download the ready complied and executable gcosts CLI program for your operating system and architecture.

Linux

Download:

  • x86_64 Intel or AMD 64-Bit CPU
    curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-linux-x86_64" \
         -o "gcosts" && \
    chmod +x "gcosts"
  • arm64 Arm-based 64-Bit CPU (i.e. in Raspberry Pi)
    curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-linux-arm64" \
         -o "gcosts" && \
    chmod +x "gcosts"

To determine your OS version, run getconf LONG_BIT or uname -m at the command line.

Execute gcosts:

./gcosts help
macOS

Download:

  • x86_64 Intel 64-bit
    curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-macos-x86_64" \
         -o "gcosts" && \
    chmod +x "gcosts"
  • arm64 Apple silicon 64-bit
    curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-macos-arm64" \
         -o "gcosts" && \
    chmod +x "gcosts"

To determine your OS version, run uname -m at the command line.

Execute gcosts:

./gcosts help
Windows

Download:

  • x86_64 Intel or AMD 64-Bit CPU
    Invoke-WebRequest -Uri "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-windows-x86_64.exe" -OutFile "gcosts.exe"
  • arm64 Arm-based 64-Bit CPU
    Invoke-WebRequest -Uri "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-windows-arm64.exe" -OutFile "gcosts.exe"

To determine your OS version, run echo %PROCESSOR_ARCHITECTURE% at the command line.

Execute gcosts.exe:

.\gcosts.exe help

2. Download price information

Download the latest and tested price information file pricing.yml. The price information is automatically regenerated on a weekly basis. Download the updated pricing file regularly.

Linux

Download pricing.yml:

curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/raw/master/pricing.yml" \
     -o "pricing.yml"
macOS

Download pricing.yml:

curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/raw/master/pricing.yml" \
     -o "pricing.yml"
Windows

Download pricing.yml:

Invoke-WebRequest -Uri "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/raw/master/pricing.yml" -OutFile "pricing.yml"

3. Run it

Prepare a separate directory (i.e. usage) just for your YAML usage files and create your first YAML usage file (resources.yml) in this directory:

region: europe-west4
project: my-first-project
instances:
  - name: app-server
    type: e2-standard-8
    os: rhel
    commitment: 3
    disks:
      - name: disk-boot
        type: ssd
        data: 75

Warning If the price list (pricing.yml) is in the same directory, errors occur because the YAML file is also parsed.

Execute the CLI program:

Linux

Execute gcosts:

./gcosts calc --pricing YML-PRICING-PATH
macOS

Execute gcosts:

./gcosts calc --pricing YML-PRICING-PATH
Windows

Execute gcosts.exe:

.\gcosts.exe calc --pricing YML-PRICING-PATH

Without extra specification of the directory all YAML files (*.yml) of the current directory are imported and the costs of the resources are calculated. You can specify the directory:

gcosts calc --dir DIRECTORY-PATH --pricing YML-PRICING-PATH

The calculated costs are exported to one CSV (comma-separated values) file. Without specifying the file location, the file is named costs.csv and is saved in the current directory. You can specify the CSV export file:

gcosts calc --csv CSV-EXPORT-FILE-PATH --pricing YML-PRICING-PATH

You can import the CSV file with MS Excel, Apple Numbers, LibreOffice or Google Sheets.

4. Get familiar

Continue to familiarize yourself with the options. The following documentations are prepared for this purpose:

๐Ÿค“ Tip

Add gcosts to your Shell aliases with absolute pathnames. You can then execute gcosts anywhere.

Alias (~/.aliases):

alias gcosts='/your-pathname/gcosts --pricing /your-pathname/pricing.yml'

โค๏ธ Contributing

Have a patch that will benefit this project? Awesome! Follow these steps to have it accepted.

  1. Please read how to contribute.
  2. Fork this Git repository and make your changes.
  3. Create a Pull Request.
  4. Incorporate review feedback to your changes.
  5. Accepted!

๐Ÿ“œ License

All files in this repository are under the Apache License, Version 2.0 unless noted otherwise.

Portions of this repository are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 4.0 Attribution License.

google-cloud-pricing-cost-calculator's People

Contributors

cyclenerd avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

google-cloud-pricing-cost-calculator's Issues

New Zones us-east5-[a,b,c]

Zones 'zones.csv' changed

Added:
us-east5-a;us-east5;UP;;
us-east5-b;us-east5;UP;;
us-east5-c;us-east5;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New Region Tel Aviv (me-west1)

Regions 'regions.csv' changed

Added:
me-west1;UP;

Deleted:

Todo:

New Zones europe-west12-[a,b,c]

Zones 'zones.csv' changed

Added:
europe-west12-a;europe-west12;UP;;
europe-west12-b;europe-west12;UP;;
europe-west12-c;europe-west12;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New Region us-east5 (Columbus)

Regions 'regions.csv' changed

Added:
us-east5;UP;

Deleted:

Todo:

M3 deleted

Machine types 'machinetypes.csv' changed

Added:

Deleted:
m3-megamem-128;128;False;1952.00;;
m3-megamem-64;64;False;976.00;;
m3-ultramem-128;128;False;3904.00;;
m3-ultramem-32;32;False;976.00;;
m3-ultramem-64;64;False;1952.00;;

Todo:

New GCE machine series M3

Machine types 'machinetypes.csv' changed

Added:
m3-megamem-128;128;False;1952.00;;
m3-megamem-64;64;False;976.00;;
m3-ultramem-128;128;False;3904.00;;
m3-ultramem-32;32;False;976.00;;
m3-ultramem-64;64;False;1952.00;;

Deleted:

Todo:

New GCE machine series T2A

Machine types 'machinetypes.csv' changed

Added:
t2a-standard-16;16;False;64.00;;
t2a-standard-1;1;False;4.00;;
t2a-standard-2;2;False;8.00;;
t2a-standard-32;32;False;128.00;;
t2a-standard-48;48;False;192.00;;
t2a-standard-4;4;False;16.00;;
t2a-standard-8;8;False;32.00;;

Deleted:

Todo:

New Machine type m2-hypermem-416

Machine types 'machinetypes.csv' changed

Added:
m2-hypermem-416;416;False;8832.00;;

Deleted:

Todo:

Google Cloud region us-south1 (Dallas) back online

Regions 'regions.csv' changed

Added:
us-south1;UP;

Deleted:

Todo:

New Region: europe-southwest1 (Madrid)

Regions 'regions.csv' changed

Added:
europe-southwest1;UP;

Deleted:

Todo:

Zones us-south1-[a,b,c] back online

Zones 'zones.csv' changed

Added:
us-south1-a;us-south1;UP;;
us-south1-b;us-south1;UP;;
us-south1-c;us-south1;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New Google Cloud region us-south1 (Dallas) was removed

Regions 'regions.csv' changed

Added:

Deleted:
us-south1;UP;

Todo:

New Google Cloud Region europe-west9 (Paris)

Today the Compute Engine API has returned machine types in europe-west9. The region will be the new location in Paris. Region and Zone as well as Billing API do not know the region yet. When the region is 100% officially ready, add the region and location to build/gcp.yml.

New Zones: europe-southwest1-[a,b,c] (Madrid)

Zones 'zones.csv' changed

Added:
europe-southwest1-a;europe-southwest1;UP;;
europe-southwest1-b;europe-southwest1;UP;;
europe-southwest1-c;europe-southwest1;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New compute-optimized machine family C3 (c3-highcpu-*)

Machine types 'machinetypes.csv' changed

Added:
c3-highcpu-176;176;False;352.00;;
c3-highcpu-22;22;False;44.00;;
c3-highcpu-44;44;False;88.00;;
c3-highcpu-4;4;False;8.00;;
c3-highcpu-88;88;False;176.00;;
c3-highcpu-8;8;False;16.00;;

Deleted:

Todo:

๐Ÿ‡ฎ๐Ÿ‡น New Region Turin (europe-west12)

Regions 'regions.csv' changed

Added:
europe-west12;UP;

Deleted:

Todo:

New Google Cloud Region europe-west9 (Paris)

Regions 'regions.csv' changed

Added:
europe-west9;UP;

Deleted:

Todo:

New: Google Cloud Region europe-west8 (Milan)

Regions 'regions.csv' changed

Added:
europe-west8;UP;

Deleted:

Todo:

New Zones me-west1-[a,b,c]

Zones 'zones.csv' changed

Added:
me-west1-a;me-west1;UP;;
me-west1-b;me-west1;UP;;
me-west1-c;me-west1;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New Accelerator type (GPU) nvidia-a100-80gb

NAME;ZONE
nvidia-a100-80gb;
nvidia-tesla-a100;
nvidia-tesla-k80;
nvidia-tesla-p100-vws;
nvidia-tesla-p100;
nvidia-tesla-p4-vws;
nvidia-tesla-p4;
nvidia-tesla-t4-vws;
nvidia-tesla-t4;
nvidia-tesla-v100;

New zones us-south1-[a,b,c]

Zones 'zones.csv' changed

Added:
us-south1-a;us-south1;UP;;
us-south1-b;us-south1;UP;;
us-south1-c;us-south1;UP;;

Deleted:

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

New Machine types a2-ultragpu (1g, 2g, 4g, 8g)

Machine types 'machinetypes.csv' changed

Added:
a2-ultragpu-1g;12;False;170.00;;
a2-ultragpu-2g;24;False;340.00;;
a2-ultragpu-4g;48;False;680.00;;
a2-ultragpu-8g;96;False;1360.00;;

Deleted:

Todo:

New Disk Type: Hyperdisk Extreme Persistent Disk

Disk types 'disktypes.csv' changed

Added:

hyperdisk-extreme;64GB-65536GB;Hyperdisk Extreme Persistent Disk

Deleted:

Todo:

New Google Cloud Region europe-west8 (Milan)

Today the Compute Engine API has returned machine types in europe-west8. The region will be the new location in Milan. Region and Zone as well as Billing API do not know the region yet. When the region is 100% officially ready, add the region and location to build/gcp.yml.

Change detected: Machine types

Machine types 'machinetypes.csv' changed

Added:
m3-megamem-128;128;False;1952.00;;
m3-megamem-64;64;False;976.00;;
m3-ultramem-128;128;False;3904.00;;
m3-ultramem-32;32;False;976.00;;
m3-ultramem-64;64;False;1952.00;;

Deleted:

Todo:

๐Ÿ‡ถ๐Ÿ‡ฆ New Google Cloud region Doha (me-central1)

Regions 'regions.csv' changed

Added:
me-central1;UP;

Deleted:

Todo:

๐Ÿ””๐Ÿค–โ„น๏ธ Google Cloud Region Changes (22-23)

This thread automatically documents changes to Google Cloud regions.

๐Ÿค– The Google Compute Engine API is fetched daily via GitHub Action.

๐Ÿ”” Subscribe to this issue if you want to be informed about new or deleted Google Cloud regions and Google Compute Engine machines types in Google Cloud regions.

Check GCE Changes

New Zones in us-south1 were deleted

Zones 'zones.csv' changed

Added:

Deleted:
us-south1-a;us-south1;UP;;
us-south1-b;us-south1;UP;;
us-south1-c;us-south1;UP;;

Todo:

  • Check changes
  • Edit title of this issue
  • Many new zones can be an indication of a new region
  • Wait until the region appears on the regions list or adjust everything already for the new region

Feature request: sole-tenant node pricing

Sole-tenant is key offering of GCP compute engine, which pricing can not get from the calculator by now.
If could include sole-tenant pricing into the calculator ?

New Google Cloud region us-south1 (Dallas)

Regions 'regions.csv' changed

Added:
us-south1;UP;

Deleted:

Todo:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.