blob: 118f4d2ddad12c8773feee3244a0ad070ec5052e (
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
61
62
63
64
65
66
67
68
69
70
|
---
layout: "azuredevops"
page_title: "AzureDevops: azuredevops_serviceendpoint_generic_git"
description: |-
Manages a generic service endpoint within Azure DevOps, which can be used to authenticate to any external git service
using basic authentication via a username and password.
---
# azuredevops_serviceendpoint_generic_git
Manages a generic service endpoint within Azure DevOps, which can be used to authenticate to any external git service
using basic authentication via a username and password. This is mostly useful for importing private git repositories.
## Example Usage
```hcl
resource "azuredevops_project" "example" {
name = "Example Project"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
description = "Managed by Terraform"
}
resource "azuredevops_serviceendpoint_generic_git" "example" {
project_id = azuredevops_project.example.id
repository_url = "https://dev.azure.com/org/project/_git/repository"
username = "username"
password = "password"
service_endpoint_name = "Example Generic Git"
description = "Managed by Terraform"
}
```
## Argument Reference
The following arguments are supported:
- `project_id` - (Required) The ID of the project.
- `service_endpoint_name` - (Required) The name of the service endpoint.
- `repository_url` - (Required) The URL of the repository associated with the service endpoint.
- `username` - (Optional) The username used to authenticate to the git repository.
- `password` - (Optional) The PAT or password used to authenticate to the git repository.
~> **Note** For AzureDevOps Git, PAT should be used as the password.
- `description` - (Optional) The Service Endpoint description. Defaults to `Managed by Terraform`.
- `enable_pipelines_access` - (Optional) A value indicating whether or not to attempt accessing this git server from Azure Pipelines.
## Attributes Reference
The following attributes are exported:
- `id` - The ID of the service endpoint.
- `project_id` - The ID of the project.
- `service_endpoint_name` - The name of the service endpoint.
- `enable_pipelines_access` - A value indicating whether or not to attempt accessing this git server from Azure Pipelines.
## Relevant Links
- [Azure DevOps Service REST API 6.0 - Agent Pools](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-6.0)
## Import
Azure DevOps Service Endpoint Generic Git can be imported using **projectID/serviceEndpointID** or
**projectName/serviceEndpointID**
```sh
terraform import azuredevops_serviceendpoint_generic_git.example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
```
|