gitlab_group_ldap_link fails with "unexpected ID format" error - ID parsing expects 4 parts but receives fewer

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Bug Report

When creating a gitlab_group_ldap_link resource, the Terraform apply succeeds in creating the LDAP link in GitLab, but fails during the read-back phase with an ID parsing error. This causes subsequent plan operations to fail as well.

Error: unexpected ID format: Group LDAP Link ID had fewer than 4 parts. Expected <group>:<LDAPProvider>:<CN>:<filter>

Expected Behavior

The provider should successfully create the LDAP group link and properly parse the ID returned by the GitLab API without errors.

Actual Behavior

  • The LDAP group link is created successfully in GitLab
  • The Terraform apply fails during the read-back operation
  • Subsequent terraform plan operations also fail with the same error
  • The resource cannot be managed by Terraform despite existing in GitLab

Relevant Terraform Configuration

resource "gitlab_group_ldap_link" "this" {
  for_each = local.groups

  group         = gitlab_group.access[each.key].id
  group_access  = "developer"
  ldap_provider = "ldapmain"
  filter        = "(&(objectClass=user)(memberOf=CN=gitlab-company,OU=Groups,OU=Main,DC=example,DC=com)))"
}

Relevant Terraform Command

terraform plan

Relevant Log Output

Error: unexpected ID format: Group LDAP Link ID had fewer than 4 parts. Expected <group>:<LDAPProvider>:<CN>:<filter>

Additional Details

  • GitLab Terraform Provider Version: 18.7.0 and 18.0.0
  • GitLab Instance Version: 18.5.1-ee
  • Terraform Version: v1.14.3
  • License Tier: Premium
Edited Jan 03, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading