-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources_tfc_variable.tf
25 lines (21 loc) · 1.23 KB
/
resources_tfc_variable.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
# The following code block is used to create variable resources.
resource "tfe_variable" "variable_set" {
for_each = nonsensitive({ for variable in local.tfc_variable_sets_variables : "${variable.variable_set} ${variable.key}" => variable })
key = each.value.key
value = each.value.key == "TFE_TOKEN" ? try(module.tfe_teams[each.value.value].token, each.value.value) : each.value.value
category = each.value.category
description = try(each.value.description, null)
hcl = try(each.value.hcl, null)
sensitive = try(each.value.sensitive, null)
variable_set_id = tfe_variable_set.this[each.value.variable_set].id
}
resource "tfe_variable" "workspace" {
for_each = nonsensitive({ for variable in local.tfc_workspace_variables : "${variable.workspace} ${variable.key}" => variable })
key = each.value.key
value = each.value.key == "TFE_TOKEN" ? try(module.tfe_teams[each.value.value].token, each.value.value) : each.value.value
category = each.value.category
description = try(each.value.description, null)
hcl = try(each.value.hcl, null)
sensitive = try(each.value.sensitive, null)
workspace_id = module.tfe_workspaces[each.value.workspace].id
}