resource "encapi_status" "this" { for_each = var.statuses name = each.key description = each.value.description } resource "encapi_role" "this" { for_each = var.roles name = each.key description = each.value.description default_params = each.value.default_params == null ? null : jsonencode(each.value.default_params) } resource "encapi_node" "this" { for_each = var.nodes certname = each.key role = each.value.role environment = each.value.environment params = each.value.params == null ? null : jsonencode(each.value.params) # Nodes FK-require their role and status to exist first. depends_on = [ encapi_role.this, encapi_status.this, ] }