Fix self-referential authentik_group parents
Adding the first managed group (argocd-admins) exposed a dormant bug: the groups resource resolved `parents` by indexing authentik_group.this itself, which OpenTofu rejects as a self-referential block. config/groups/ had been empty, so `tofu plan` never hit it before. Pass `parents` through as literal group PKs instead (the resource cannot reference itself, so parent-by-map-key was never viable). Plan is clean: 3 to add (argocd provider, application, argocd-admins group).
This commit is contained in:
@@ -3,7 +3,7 @@ resource "authentik_group" "this" {
|
||||
|
||||
name = each.value.name
|
||||
is_superuser = each.value.is_superuser
|
||||
parents = each.value.parents != null ? [for p in each.value.parents : authentik_group.this[p].id] : []
|
||||
parents = each.value.parents
|
||||
attributes = jsonencode(each.value.attributes)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user