digitalocean_projects

Retrieve information about all DigitalOcean projects associated with an account, with the ability to filter and sort the results. If no filters are specified, all projects will be returned.

Note: You can use the digitalocean_project data source to obtain metadata about a single project if you already know the id to retrieve or the unique name of the project.

Example Usage

Use the filter block with a key string and values list to filter projects.

For example to find all staging environment projects:

data "digitalocean_projects" "staging" {
  filter {
    key    = "environment"
    values = ["Staging"]
  }
}

You can filter on multiple fields and sort the results as well:

data "digitalocean_projects" "non-default-production" {
  filter {
    key    = "environment"
    values = ["Production"]
  }
  filter {
    key    = "is_default"
    values = ["false"]
  }
  sort {
    key       = "name"
    direction = "asc"
  }
}

Argument Reference

filter supports the following arguments:

sort supports the following arguments:

Attributes Reference