digitalocean_projects
Generated on 15 Jan 2026
from Terraform version
v2.73.0
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- (Optional) Filter the results. Thefilterblock is documented below. -
sort- (Optional) Sort the results. Thesortblock is documented below.
filter supports the following arguments:
-
key- (Required) Filter the projects by this key. This may be one ofname,purpose,description,environment, oris_default. -
values- (Required) A list of values to match against thekeyfield. Only retrieves projects where thekeyfield takes on one or more of the values provided here. -
match_by- (Optional) One ofexact(default),re, orsubstring. For string-typed fields, specifyreto match by using thevaluesas regular expressions, or specifysubstringto match by treating thevaluesas substrings to find within the string field. -
all- (Optional) Set totrueto require that a field match all of thevaluesinstead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevaluesare present in the list or set.
sort supports the following arguments:
key- (Required) Sort the projects by this key. This may be one ofname,purpose,description, orenvironment.direction- (Required) The sort direction. This may be eitherascordesc.
Attributes Reference
projects- A set of projects satisfying anyfilterandsortcriteria. Each project has the following attributes:id- The ID of the projectname- The name of the projectdescription- The description of the projectpurpose- The purpose of the project (Default: “Web Application”)environment- The environment of the project’s resources. The possible values are:Development,Staging,Production.resources- A set of uniform resource names (URNs) for the resources associated with the projectowner_uuid- The unique universal identifier of the project ownerowner_id- The ID of the project ownercreated_at- The date and time when the project was created, (ISO8601)updated_at- The date and time when the project was last updated, (ISO8601)