-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
45 lines (39 loc) · 1.32 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
resource "azuredevops_build_definition" "main" {
project_id = var.project_id
name = var.name
path = var.path != null ? "\\${var.path}" : var.path
agent_pool_name = var.agent_pool_name
ci_trigger {
use_yaml = var.use_yaml
}
repository {
repo_type = var.repo_type
repo_id = var.repo_id
branch_name = "refs/heads/${var.branch_name}"
yml_path = var.yml_path
}
dynamic "variable" {
for_each = {for v in var.variables : v["name"] => v}
content {
name = variable.value["name"]
value = variable.value["value"]
is_secret = variable.value["is_secret"]
secret_value = variable.value["secret_value"]
allow_override = variable.value["allow_override"]
}
}
dynamic "schedules" {
for_each = var.schedules.enabled ? [1] : []
content {
days_to_build = var.schedules.days_to_build
start_hours = var.schedules.start_hours
start_minutes = var.schedules.start_minutes
time_zone = var.schedules.time_zone
schedule_only_with_changes = var.schedules.schedule_only_with_changes
branch_filter {
include = var.schedules.branch_filter_include
exclude = var.schedules.branch_filter_exclude
}
}
}
}