Prepare and test your skills

Prepare and test your skills

Gemini Cloud Assist (opens in a new tab) is a generative AI assistant built into Google Cloud that helps analyze resources, costs, and problems. You interact with it through the Cloud Assist panel in the Google Cloud console, where it works through the Cloud AI Companion API (opens in a new tab) together with the Gemini Cloud Assist API. It reads environment context such as telemetry, logs, and inventory metadata to answer questions, suggest code, and recommend fixes.
Querying with Gemini Cloud Assist means asking about Google Cloud resources in plain English instead of writing API calls or manual filters. You type a prompt in the Cloud Assist panel, Gemini Cloud Assist analyzes the current project context, and it returns an answer, code snippet, or next step. When you are on a specific console page, the answer uses that page context, such as showing CPU utilization when you are viewing a Cloud SQL instance.
Example status questions show the range of this capability:
How many BigQuery datasets have a label whose value is 'inventory'?Where are my databases located?Show me all databases running on Postgres.What are the top users with the most slot usage in my project?Generate a SQL query to show me the direction and subscriber type for the 10 longest trips.Gemini Cloud Assist can also generate BigQuery (opens in a new tab) SQL or Python code from a description, so data flows from your description in the Cloud Assist panel to a ready-to-review query for the BigQuery query editor. Choose natural-language querying when you need fast visibility across projects, datasets, databases, and usage without building a custom report first.
Optimization recommendations from Gemini Cloud Assist are AI-driven suggestions that reduce wasted work and improve efficiency. For BigQuery, Gemini Cloud Assist analyzes your query structure and suggests improvements to potentially reduce query slot time. You can get this help by clicking Optimize in the query editor after running a query, or by opening the query in a tab or pasting the SQL directly into the Cloud Assist panel and asking for an optimization.
The same recommendation engine supports cost work on the FinOps Utilization insights dashboard, where Gemini Cloud Assist surfaces top utilization insights based on potential costs of wasted resources. From that dashboard you can draft an email report with identified waste and optimization links, then click Copy to paste the text and links into email, chat, or a ticketing system. An optimized query often lowers slot milliseconds, but it might not always lower cost directly because pricing constraints such as minimum billing thresholds still apply.
Troubleshooting with Gemini Cloud Assist investigations uses contextual analysis of logs and metrics to explain infrastructure and application issues. The investigations feature is available to users with a Premium Support contract or access through their account team, and it requires the Investigation Creator Identity and Access Management (IAM) role and the enabled geminicloudassist.googleapis.com API. Once enabled, Gemini Cloud Assist creates persistent analysis that you can review, save, share, and attach to a Google Cloud support case.
You start an investigation directly from chat or from a workload page through an ordered workflow:
For Managed Service for Apache Spark (opens in a new tab) (formerly Dataproc on Compute Engine cluster deployment and Serverless for Apache Spark), the INVESTIGATE button appears in the Insights by Gemini column for a Failed batch on the batches list, and in the Health overview for Succeeded and Failed batches on the batch details page. Investigation results are organized into Issue with auto-populated workload details, Relevant Observations with key data points and anomalies from logs and metrics, and Hypotheses with possible root causes such as high shuffle write time, each with an Overview and Recommended Fixes. After review, apply one or more fixes and rerun the job, leave thumbs-up or thumbs-down feedback, and open a support case with full context if further help is needed.
Data freshness and access boundaries for Gemini Cloud Assist depend on upstream sources such as Cloud Asset Inventory (opens in a new tab), Cloud Monitoring, and Cloud Logging. Cloud Asset Inventory provides organization-wide visibility for compliance tracking, scheduled audits, and analytics, but it uses periodic synchronization with eventual consistency, possible indexing delays, and potential temporary drops, lag, or out-of-order deliveries. Because of that lag, Cloud Asset Inventory is not a synchronous control plane and must not be used as a live source of truth where stale data could break availability or security enforcement.
The choice between inventory data and live data splits by urgency. Cloud Asset Inventory fits scheduled compliance audits, IAM policy analysis, drift reporting, multi-project batch cataloging, BigQuery exports, cost allocation, and asynchronous Pub/Sub notifications for delay-tolerant updates. The service API directly fits real-time inline threat blocking, immediate access revocation, live source of truth for runtime and data plane state, and immediate synchronized orchestration dependencies. When a critical task requires instant validation, such as verifying a firewall rule before traffic cutover, call the corresponding service API instead of relying on inventory data.
A decision tree starting from a task need, branching on whether immediate validation is required: delay-tolerant needs route to Cloud Asset Inventory for audits, exports, and Pub/Sub feeds, while urgent needs route to calling the service API directly for live state.
Exam tip: Use Cloud Asset Inventory for scheduled audits and delay-tolerant background reconciliation, but use the service API directly when you need immediate validation before a cutover.
Cloud Asset Inventory (opens in a new tab) is a global metadata inventory service that lets you view, search, export, monitor, and analyze metadata for Google Cloud assets. The service collects metadata from Google Cloud resources, policies, and runtime information into one repository for compliance tracking, scheduled audits, and analytics. Create, update, and delete history is kept for up to 35 days, and assets that have not changed in the past 35 days return their latest status.
An asset export is a snapshot of asset metadata that flows from Cloud Asset Inventory to a Cloud Storage bucket or a BigQuery dataset for storage outside the 35-day history window. The export preserves the inventory at a point in time so teams can keep an audit trail, debug past problems, and track compliance drift over months or years. Because the inventory itself only retains detailed change history for 35 days, exports provide the long-term record needed for scheduled audits and analytics.
| Destination | What is stored | Use when you need to |
|---|---|---|
| Cloud Storage | Dump files of asset metadata for an organization or project at a given timestamp | Keep low-cost, long-term audit files and compliance snapshots |
| BigQuery | Asset metadata tables that you can query with SQL | Run analytics and custom SQL queries across large asset sets |
Exports are scoped to a project, folder, or organization and can be limited by asset type and content type. When no content type is specified, only a basic response is returned with the asset name, the last time it was updated, and the projects, folders, and organizations it belongs to. Requesting full resource, policy, or relationship content returns the additional metadata needed for security and cost audits.
The search function (opens in a new tab) finds current and recent resources and Identity and Access Management (IAM) allow policies using a custom query language against the inventory. A search request flows from the caller to Cloud Asset Inventory with a scope of project, folder, or organization, and the service returns only the assets that match the query filters. Search supports discovery and management without calling each service API directly, which makes it useful for finding over-permissioned, publicly exposed, or unused resources.
Search results can be filtered by metadata properties, including:
Search and list requests (opens in a new tab) support snapshot time, asset type filtering, and pagination to control large results. Snapshot time must use RFC 3339 format and be no more than 35 days in the past, and when no time is given the snapshot is taken at the current time. Asset type filters accept RE2-compatible regular expressions and return an INVALID_ARGUMENT error when the expression matches no supported type, while page size supports a maximum of 500 results per page with a nextPageToken for retrieving the next page.
Exam tip: Cloud Asset Inventory is not designed for real-time querying where missing or stale data could break availability or security enforcement — call the service API directly for live data, and keep snapshot time within the last 35 days.
Analyzing IAM policies and resource relationships means using Cloud Asset Inventory (opens in a new tab) to see who can access what and how cloud resources connect to each other. Cloud Asset Inventory collects resource metadata and Identity and Access Management (IAM) policies from across projects, folders, and organizations into one searchable repository. Gemini Cloud Assist (opens in a new tab) can then read that inventory data to explain complex permissions, highlight risky access, and describe dependencies in plain language.
Cloud Asset Inventory provides organization-wide visibility across Google Cloud resources, IAM policies, and metadata history. Data flows from individual Google Cloud services to Cloud Asset Inventory, and from Cloud Asset Inventory to search queries, exports, and Pub/Sub feeds used for audits and dashboards. The service is designed for compliance tracking, scheduled audits, and analytics, and it is not a synchronous control plane. Because of this design, Cloud Asset Inventory is not suitable for real-time enforcement where missing or stale data could break availability or security.
Searching IAM policies and resources finds the current catalog of assets and the policies attached to them within a chosen scope. The search scope can be a project, folder, or organization, and results are filtered with a query that specifies fields such as asset type, labels, location, state, or policy bindings. Two search operations divide the work: searchAllResources returns resource metadata, while searchAllIamPolicies returns IAM allow and deny policies.
A basic resource search in the Google Cloud console follows an ordered workflow:
The same search can run from the command line with gcloud asset search-all-resources, which takes a scope path, query string, asset types, and ordering options. Searching is a synchronous operation, so very large inventories should use asynchronous query methods to protect quota.
Effective permission analysis answers who actually has access to a resource after inheritance and overlapping policies are combined. The analysis APIs, including analyze-iam-policy, analyze-iam-policy-longrunning, and get-effective-iam-policy, evaluate IAM hierarchies across the organization, folder, project, and resource levels. The analysis depends on both the resource catalog and the policy catalog, so the caller must be able to read both to produce a complete result.
Calling these analysis APIs requires a specific set of permissions:
cloudasset.assets.analyzeIamPolicy to run the analysiscloudasset.assets.searchAllIamPolicies to read policy datacloudasset.assets.searchAllResources to read resource dataiam.roles.get to resolve custom roles used in the policiesEvery Cloud Asset Inventory call also requires serviceusage.services.use. This permission set lets the analysis read inherited bindings, custom role definitions, and the resources those bindings apply to, which makes overly broad access and unintended inheritance easier to spot.
Resource relationship data shows how cloud entities depend on each other, such as which instances, disks, networks, and IAM bindings belong to the same application. Related-resource search returns connected Google Cloud resources for a starting asset, so an administrator can trace from a virtual machine to its network, service account, and governing policies. That trace moves outward from the selected resource to its dependencies, which helps identify security risks like a sensitive database reachable through a broadly shared network or service account.
Change tracking and exports extend this view over time. Inventory data can be exported to BigQuery for multi-project cataloging, cost allocation, and drift reporting that compares current policies against a known-good baseline. Pub/Sub feeds send asynchronous notifications when assets or IAM policies change, and downstream consumers treat those messages as informative signals that may arrive delayed or out of order.
Gemini Cloud Assist interpretation explains inventory and IAM findings in plain language with links back to the evidence. The assistant reads data that the user or its agent identity is explicitly authorized to see, including Cloud Asset Inventory, Cloud Monitoring, and Cloud Logging, and every proactive insight includes citations that link back to the source alert or log. In Proactive Mode, Gemini Cloud Assist runs in the background under a dedicated agent identity and only accesses data granted through IAM roles on that identity.
Access for analysis comes from two sides that must both be present. The user needs Gemini permissions such as geminicloudassist.agents.invoke to talk to agents and cloudaicompanion.topics.create to start a chat, plus task-specific roles for the domain being examined, such as logging viewer or network administrator roles. The agent identity is limited by default to read-only access and cannot read database or storage bucket contents unless those permissions are explicitly granted, as described in Gemini for Google Cloud API roles and permissions (opens in a new tab).
Inventory analysis is delay-tolerant, while direct service calls reflect immediate state. Cloud Asset Inventory uses periodic synchronization, so newly created or changed resources and policies can take time to appear in search, feeds, and exports, and temporary drops or out-of-order delivery are possible. For critical checks such as verifying a firewall rule before traffic cutover or revoking access right now, call the service API directly instead of the inventory.
| Architectural need | Use Cloud Asset Inventory | Use the service API directly |
|---|---|---|
| Security and compliance | Scheduled compliance audits, IAM policy analysis, and drift reporting | Real-time inline threat blocking or immediate access revocation |
| Inventory management | Multi-project batch cataloging, BigQuery exports, and cost allocation | Live source of truth for runtime application state |
| Change tracking | Asynchronous Pub/Sub notifications for delay-tolerant updates | Immediate, synchronized orchestration dependencies |
Exam tip: Use Cloud Asset Inventory for scheduled IAM analysis and drift reporting, and use the service API directly when you must verify or revoke access immediately.
Use Cloud Asset Inventory for scheduled compliance audits, Identity and Access Management (IAM) policy analysis, drift reporting, multi-project batch cataloging, BigQuery exports, cost allocation, and asynchronous Pub/Sub notifications for delay-tolerant updates. Use the service API directly for real-time inline threat blocking, immediate access revocation, live source of truth for runtime state, and immediate synchronized orchestration dependencies such as verifying a firewall rule before traffic cutover. Cloud Asset Inventory uses periodic synchronization with eventual consistency and possible delays, so it must not be used as a live source of truth where stale data could break availability or security enforcement.
Cloud Asset Inventory keeps create, update, and delete history for up to 35 days, and assets unchanged in the past 35 days return their latest status. An asset export preserves a point-in-time snapshot to a Cloud Storage bucket as dump files for low-cost long-term audit files or to a BigQuery dataset as tables for analytics and custom SQL queries. Search snapshot time must use RFC 3339 format and be no more than 35 days in the past, with a maximum page size of 500 results per page.
Effective permission analysis with Cloud Asset Inventory requires cloudasset.assets.analyzeIamPolicy to run the analysis, cloudasset.assets.searchAllIamPolicies to read policy data, cloudasset.assets.searchAllResources to read resource data, and iam.roles.get to resolve custom roles. Every Cloud Asset Inventory call also requires serviceusage.services.use. The analysis evaluates Identity and Access Management (IAM) hierarchies across organization, folder, project, and resource levels, so the caller must be able to read both the resource catalog and the policy catalog.
Your team wants to use Gemini Cloud Assist in the Google Cloud console to gain AI-driven insights, analyze resource configurations, and accelerate troubleshooting through natural language prompts.
You need to ensure that Gemini Cloud Assist can provide full contextual answers when querying resource metadata inventory (such as listing deployed resources and asset history) and operational performance data (such as identifying VMs with high utilization).
Which Google Cloud APIs should be enabled in the project to support these capabilities?
Last updated