terraform-provider-google/website/docs/d/google_projects.html.markdown
The Magician 08a2b15746 Add a datasource for retrieving a list of projects (#3178)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-03-04 13:58:27 -08:00

1.1 KiB

layout page_title sidebar_current description
google Google: google_projects docs-google-datasource-projects Retrieve a set of projects based on a filter.

google_projects

Retrieve information about a set of projects based on a filter. See the REST API for more details.

Example Usage - searching for projects about to be deleted in an org

data "google_projects" "my-org-projects" {
  filter = "parent.id:012345678910 lifecycleState:DELETE_REQUESTED"
}

data "google_project" "deletion-candidate" {
   project_id = "${data.google_projects.my-org-projects.projects.0.project_id}"
}

Argument Reference

The following arguments are supported:

  • filter - (Optional) A string filter as defined in the REST API.

Attributes Reference

The following attributes are exported:

  • projects - A list of projects matching the provided filter. Structure is defined below.

The projects block supports:

  • project_id - The project id of the project.