Giter VIP home page Giter VIP logo

googleresourceinventory's Introduction

Google Resource Inventory

  • This is not a Google product or software
  • Use the new version in python. The old scripts stays in place for historic.

A script that extracts information from one, or more, GCP projects, that can be used for any kind of analysis. Its a inventory of your cloud.

Calling the collect.py program the process read and exports data to csv ou excel, you choose.

Recommendations

  • Use a Service Account that has ONLY read-only access, although this script does not change anything in the cloud, it's a good practice to give only the access needed.

How to use

pip3 install -r requirements.yaml
./collect.py

. Requirements file generated by pipreqs.

Exporting Data

You can save the collect date to csv, xls or json, by using the -o parameter. If ommited will assume the default csv. The files will going to be saved in ./output folder. Example: Save both to csv and xls.

./collect.py -o csv -o xls

Output patterns:

Type Output
xls output.xlsx
csv output_{resource_type}.csv
json output_{resource_type}.json

Limitating Resource

By using the parameters -r is possible to determine just a kind of resources to collect data. This parameters can be used multiple times. Example: Collect data of gcs and gke only:

./collect.py -r gcs -r gke
Resource Option
Virtual Machines compute
CloudSql sql
Deployment Manager deployment
Network (VPC/VPN) network
Functions functions
GCS gcs
GKE gke
Artifact Repository art_repo
PubSub pubsub

Which GCP resources that is collected?

  • Virtual Machines
  • CloudSQL
  • Functions
  • GCS
  • GKE
  • Artifact Registry
  • PubSub
  • Deployment Manager
  • VPC
  • VPN

Collect from multiple projects

By passing parameter -m will allow to loop through multiple projects. Text file format: List of project_id(Number) saperated by new line. i.e:

./collect.py -m projects.txt -r compute

Questions

  • Question: Why reading compute machines that some time?
    Response: During the process of reading compute machines, the collector reads also the 1-The metrics of CPU from the monitoring service 2-Get the machineType for CPU e mem

googleresourceinventory's People

Contributors

rafaeldomi avatar

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.