Retrieve all the resources within a given accessible CRM scope (project/folder/organization). See the REST API for more details.
data google_cloud_asset_resources_search_all projects {
provider = google-beta
scope = "organizations/0123456789"
asset_types = [
"cloudresourcemanager.googleapis.com/Project"
]
}
data google_cloud_asset_resources_search_all cloud_build_projects {
provider = google-beta
scope = "organizations/0123456789"
asset_types = [
"serviceusage.googleapis.com/Service"
]
query = "displayName:cloudbuild.googleapis.com AND state:ENABLED"
}
data google_cloud_asset_resources_search_all project_service_accounts {
provider = google-beta
scope = "projects/my-project-id"
asset_types = [
"iam.googleapis.com/ServiceAccount"
]
}
The following arguments are supported:
scope
- (Required) A scope can be a project, a folder, or an organization. The allowed value must be: organization number (such as "organizations/123"), folder number (such as "folders/1234"), project number (such as "projects/12345") or project id (such as "projects/abc")asset_types
- (Optional) A list of asset types that this request searches for. If empty, it will search all the supported asset types. query
- (Optional) The query statement. See how to construct a query for more information. If not specified or empty, it will search all the resources within the specified scope
and asset_types
.The following attributes are exported:
results
- A list of search results based on provided inputs. Structure is defined below.name
- The full resource name. See Resource Names for more information.asset_type
- The type of this resource. project
- The project that this resource belongs to, in the form of projects/{project_number}
.display_name
- The display name of this resource.description
- One or more paragraphs of text description of this resource. Maximum length could be up to 1M bytes.additional_attributes
- Additional searchable attributes of this resource. Informational only. The exact set of attributes is subject to change. For example: project id, DNS name etc.location
- Location can be global
, regional like us-east1
, or zonal like us-west1-b
.labels
- Labels associated with this resource.network_tags
- Network tags associated with this resource.