Search code examples
jsongoogle-cloud-platformvirtual-machineinventoryinventory-management

How to make GCP VMs inventory in table format instead of JSON file?


I want to make a table in GCP that contains all VMs details, I try to use asset api but it export a JSON file which is not readable.

I want an approach to convert this unreadable JSON file to a readable table, or if there is any feature in GCP that allows us to make an inventory table for VMs in a readable way?


Solution

  • You can export your assets into BigQuery

    In my company, we perform this export every day with a scheduled Cloud Functions. The traps is that every day, the content of the table is overridden.

    So, 2 hours after the CLoud Functions scheduling, we have a BigQuery scheduled query that selects all the data of the asset inventory export and that inserts them into a partitioned table.

    And we request the assets that we want into this partitioned table.