-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
47 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
46
47
resource "tfe_workspace" "self" {
agent_pool_id = var.agent_pool_id
allow_destroy_plan = var.allow_destroy_plan
assessments_enabled = var.assessments_enabled
auto_apply = var.auto_apply
description = var.description
execution_mode = var.execution_mode
name = var.name
organization = data.tfe_organization.self.name
project_id = var.project_id
tag_names = var.tags
dynamic "vcs_repo" {
for_each = var.vcs_repo != null ? [1] : []
content {
identifier = var.vcs_repo.identifier
github_app_installation_id = var.vcs_repo.github_app_installation_id
}
}
}
resource "tfe_variable" "self" {
for_each = { for v in var.variables : v.key => v }
category = each.value.category
description = each.value.description
hcl = each.value.hcl
key = each.value.key
sensitive = each.value.sensitive
value = each.value.value
workspace_id = tfe_workspace.self.id
}
resource "tfe_workspace_variable_set" "self" {
for_each = toset(var.variable_set_ids)
variable_set_id = each.key
workspace_id = tfe_workspace.self.id
}
resource "tfe_run_trigger" "self" {
for_each = toset(var.run_trigger_workspace_ids)
sourceable_id = each.key
workspace_id = tfe_workspace.self.id
}