Description
Enable cloudasset.googleapis.com in the project that uses the Cloud Asset Inventory API to query or export assets.
Potential impact
Failed queries or exports can leave a central review without the information needed to identify unknown assets or excessive IAM permissions.
Remediation
Grant only the IAM permissions needed at the query scope. Check support for the asset types you need and their update times. For periodic exports or change notifications, configure a schedule or feed separately and verify delivery.
Examples
Before
resource "google_project_service" "example" {
service = "compute.googleapis.com"
}
After
resource "google_project_service" "example" {
service = "compute.googleapis.com"
}
resource "google_project_service" "asset_inventory" {
service = "cloudasset.googleapis.com"
}
Both configurations retain the Compute API. The second adds Asset Inventory as a separate resource in the project selected by the provider or equivalent configuration. The first excerpt does not establish the status of other APIs.