summaryrefslogtreecommitdiff
path: root/website/docs/d/projects.html.markdown
blob: 8c1218f6f2272ae56ac5c301b9a3477749184b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
layout: "azuredevops"
page_title: "AzureDevops: azuredevops_projects"
description: |-
  Use this data source to access information about a existing Projects within Azure DevOps.
---

# Data Source: azuredevops_projects

Use this data source to access information about existing Projects within Azure DevOps.

## Example Usage

```hcl
data "azuredevops_projects" "example" {
  name  = "Example Project"
  state = "wellFormed"
}

output "project_id" {
  value = data.azuredevops_projects.example.projects.*.project_id
}

output "name" {
  value = data.azuredevops_projects.example.projects.*.name
}

output "project_url" {
  value = data.azuredevops_projects.example.projects.*.project_url
}

output "state" {
  value = data.azuredevops_projects.example.projects.*.state
}
```

## Argument Reference

The following arguments are supported:

- `name` - (Optional) Name of the Project, if not specified all projects will be returned.

- `state` - (Optional) State of the Project, if not specified all projects will be returned. Valid values are `all`, `deleting`, `new`, `wellFormed`, `createPending`, `unchanged`,`deleted`.

DataSource without specifying any arguments will return all projects.

## Attributes Reference

The following attributes are exported:

- `projects` - A list of existing projects in your Azure DevOps Organization with details about every project which includes:

  - `project_id` - Project identifier.
  - `name` - Project name.
  - `project_url` - Url to the full version of the object.
  - `state` - Project state.

## Relevant Links

- [Azure DevOps Service REST API 6.0 - Projects - Get](https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/get?view=azure-devops-rest-6.0)