-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
88 lines (74 loc) · 2.08 KB
/
main.tf
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
provider "azuredevops" {
org_service_url = "https://dev.azure.com/Intelion-UK"
}
terraform {
backend "azurerm" {
}
required_providers {
azuredevops = {
source = "terraform-providers/azuredevops"
}
}
}
resource "azuredevops_project" "test" {
project_name = var.project_name
description = var.project_description
visibility = "private"
version_control = var.version_control
work_item_template = var.work_item_template
features = {
"testplans" = "disabled"
"artifacts" = "disabled"
}
}
resource "azuredevops_git_repository" "repo" {
project_id = azuredevops_project.test.id
name = var.repo_name
initialization {
init_type = "Uninitialized"
}
}
resource "azuredevops_user_entitlement" "admin" {
principal_name = var.project_admin_user_email
}
data "azuredevops_group" "project_admins_group" {
project_id = azuredevops_project.test.id
name = "Project Administrators"
}
resource "azuredevops_group_membership" "project_admins_membership" {
group = data.azuredevops_group.project_admins_group.descriptor
members = [
azuredevops_user_entitlement.admin.descriptor
]
}
resource "azuredevops_serviceendpoint_azurerm" "endpointazure" {
project_id = azuredevops_project.test.id
service_endpoint_name = "AzureRM"
azurerm_spn_tenantid = var.tenant_id
azurerm_subscription_id = var.subscription_id
azurerm_subscription_name = var.subscription_name
}
/* resource "azuredevops_build_definition" "build" {
project_id = azuredevops_project.test.id
name = "Sample Build Definition"
path = "\\terraform-example"
ci_trigger {
use_yaml = true
}
repository {
repo_type = "GitHub"
service_connection_id = "Azure DevOps Platform"
repo_id = "liamfoneill/AzureDevOpsBootstrap"
branch_name = "master"
yml_path = "hello-world.yml"
}
variable {
name = "PipelineVariable"
value = "Go Microsoft!"
}
variable {
name = "PipelineSecret"
secret_value = "ZGV2cw"
is_secret = true
}
} */