Search code examples
google-cloud-platformansibleterraformgcloudinventory

Generating inventory of GCP resources


I need to generate inventory for all my GCP resources. For this I can go through each of the components like VPC , Compute Engines , IAM and generate the inventory manually . I am looking for some tool like gcloud or using automation software like terraform/ansible to generate the inventory. Any suggestions ?


Solution

  • Yes, you can use Cloud Asset Inventory for this.

    Here is a link to the quickstart guide.

    My Cloud Shell was already properly configured so I only had to run:

    gcloud beta asset search-all-resources
    

    Enable the API if asked when running the above command.