Questions tagged [google-cloud-asset-inventory]

Cloud Asset Inventory provides inventory services based on a time series database. This database keeps a five-week history of Google Cloud asset metadata.

Cloud Asset Inventory provides inventory services based on a time series database. This database keeps a five-week history of Google Cloud asset metadata. Cloud Asset Inventory allows you to:

  • Search asset metadata by using a custom query language
  • Export all asset metadata at a certain timestamp or export event change history during a specific timeframe
  • Monitor asset changes by subscribing to real-time notifications
  • Analyze IAM policy to find out who has access to what
14 questions
4
votes
2 answers

GCP: List members of all groups in an organization using gcloud CLI, output to BigQuery

I would like to use the gcloud CLI to create a table of all users in Google IAM groups in our organziation, and output to a BQ table. I know it involves "gcloud identity groups memberships list" but not clear on how to iterate through the groups and…
3
votes
0 answers

GCP AUTH_PERMISSION_DENIED When Executing Cloud Asset Export

I ran gcloud asset export --content-type resource --project jcalderon-openx-sandbox --asset-types container.googleapis.com/Cluster --output-path "gs://mybucket/NEW_FILE" and got the following error: details: - '@type':…
user994165
  • 9,146
  • 30
  • 98
  • 165
1
vote
2 answers

Cloud Asset API not enabled

Our project has enabled Cloud Asset Inventory API, I can view it from UI, but I get this permission error. I am the owner of the project. ➜ gcloud auth login Your browser has been opened to visit: --- You are now logged in as [myemail]. ➜…
1
vote
0 answers

Difference between ListAssets and SearchAllResources

I'm trying to list every resource in a given Google Cloud project. I was using the SearchAllResources endpoint so far. I'm now struggling to list cloudfunctions.googleapis.com/CloudFunction resources. This resource is supported by the search…
1
vote
1 answer

How can I find the number of Compute Engine Instances with a COS image vs the number of instances with a non-COS image?

I am able to identify all the images that are available to my Compute Engine instances and can identify the sourceImage of a single instance however I need to always state a zone so I am struggling to figure out how to build on the command gcloud…
0
votes
1 answer

Listing Google Cloud Marketplace Purchases using Asset Inventory API and/or Billing API in Java

I am currently working on a Java application that utilizes the Google Cloud Asset Inventory API to list all the assets within various projects of a company. Now, I am facing the challenge of listing all the products purchased on the Google Cloud…
0
votes
0 answers

Getting a list of all VMs from all Projects in GCP with OS details

I am trying get a list of all the VM instances only and exclude all GKE instances using the Asset inventory in GCP. I was able to get the details using the query gcloud asset search-all-resources \ --scope='organizations/<**Organization ID**>'…
0
votes
1 answer

Cloud Asset Organization feed for deleted/created resource

I am creating a asset feed for the deleted/created resource. The code below and the link is showing the expression only for when the resources are getting created, but I want another feed when resources are getting deleted only. Reference link -…
0
votes
1 answer

Google cloud asset assets.list REST API Quota exceeded error returned

I'm trying to use cloud asset inventory assets.list REST API request from my code and after reaching the maximum quota I get the following error: "Quota exceeded for quota metric 'ListAssets Requests' and limit 'ListAssets Requests per minute' of…
0
votes
1 answer

Object of type Asset is not JSON serializable

I am using GCP's Python client APIs for listing cloud assets. I need to move that output to a CSV file. But I can't because it is showing TypeError: Object of type Asset is not JSON serializable My code response = client.list_assets( request={ …
0
votes
2 answers

How to get json representation from search_all_iam_policies() results

I'm working to implement the search_all_iam_policies() method in google-cloud-asset as follows: from google.cloud import asset_v1 ASSET_CLIENT = asset_v1.AssetServiceClient() response = ASSET_CLIENT.search_all_iam_policies( …
Michael
  • 1,428
  • 3
  • 15
  • 34
0
votes
1 answer

How best to handle async response from google long running operation with cloud functions

I'm using Google Cloud Functions (python) to initiate an asset inventory export from GCP by calling the exportAssets() method here. The method returns an Operations object defined here which can be used to poll the operation until it is complete. …
0
votes
1 answer

"ERROR: (gcloud.asset.export) User does not have permission" only when authenticated with a service account

I'm trying to export project assets with Google Cloud Asset Inventory and gcloud command (version 314.0.0) authenticated with a service account : # 1. authenticate with service account my-service-account@$PROJECT_ID.iam.gserviceaccount.com gcloud…
norbjd
  • 10,166
  • 4
  • 45
  • 80
0
votes
1 answer

Why does the cloudasset.googleapis.com API not list storage buckets?

When running gcloud asset search-all-resources --scope=projects/my-project I get resources listed from many Google APIs: container.googleapis.com, compute.googleapis.com, cloudresourcemanager.googleapis.com, iam.googleapis.com and more What's…