Google Cloud Asset Inventory
Google Cloud Asset Inventory is a powerful input component that enables the collection and ingestion of asset data from Google Cloud Platform environments. It provides comprehensive visibility into cloud resources across organizations, folders, and projects. The component supports scanning various asset types and can be configured to run on a scheduled basis. It is compatible with both organization and project-level scanning, making it suitable for both enterprise-wide and project-specific asset inventory needs.
Sync Type: Full Synchronisation
Requirements
Required Permissions
- Cloud Asset Viewer role (roles/cloudasset.viewer); this is the only role the connector uses
- The Cloud Asset API (
cloudasset.googleapis.com) enabled on the service account's project
IAM permissions
Setting up IAM permissions in GCP can be complicated. However, we can greatly simplify the setup of a service account by using the gcloud cli tool, which is also available in the web console.
Code
Configuration Options
Settings
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
resource_names | array of string | Yes | - | The resources to query assets from. |
asset_types | array of string | No | - | The types of assets to query for. see https://cloud.google.com/asset-inventory/docs/asset-types for details |
cron | string (cron) | Yes | 0 * * * * | Cron string for scheduling the ingest of your input. eg: 0 0 * * * - Daily at midnight, or */15 * * * * - Every 15 minutes. Defaults to an hour. |
use_synthetic_data | bool | No | false | Generate synthetic data for testing, instead of connecting to a real data source. Defaults to an hourly cron schedule for cron-based inputs. |
Secrets
| Secret | Type | Required | Description |
|---|---|---|---|
credentials_json | secret | Yes | JSON credentials to authenticate with Google Cloud. |
Example Configuration
Code
Functionality
The component operates by:
- Authenticating with Google Cloud using provided credentials
- Iterating through specified resource names (organizations/folders/projects)
- Querying the Cloud Asset Inventory API for the specified asset types, fetching resource metadata only (content type
RESOURCE; IAM, organization and access policies are not collected) - Wrapping each asset as
{asset, resource_name, last_seen}, wherelast_seenis the fetch time - Streaming results through the data channel
Test Connection validates the first resource name only; problems with other resource names surface at run time.
Best Practices
- Use organization-level scanning when possible for comprehensive visibility
- Implement appropriate RBAC for service accounts
- Schedule scans during off-peak hours
- Filter asset types to reduce unnecessary data collection
Limitations
- API quotas and rate limits apply
- Some asset types may not be available at project level
- Historical asset data limited by GCP retention policies
Troubleshooting
Common Issues
- Insufficient IAM permissions
- Invalid resource names
- API quotas exceeded
Resolution Steps
- Verify service account permissions
- Validate resource name format
- Check API quotas in Cloud Console
API Reference
This component uses the Cloud Asset API v1
Endpoint: https://cloudasset.googleapis.com/v1
API Example
Code
Related Resources
Sample Record
Code
Sync frequency
This input runs on a cron schedule (default hourly, 0 * * * *), which you can configure on the pipeline. See Input Sync Frequency for details.