Skip to content

realm_attributes is not updating when terraform config changes #1104

Open
@richardmcsong

Description

@richardmcsong

Describe the bug
When the LDAP realm_attributes string is updated on the artifactory_group
resource, the plan reports that the realm string will be updated, but the realm
string is not actually updated.

resource "artifactory_group" "example" {
  name = "example"
  realm = "ldap"
  realm_attributes = "ldapGroupName=example_team;groupsStrategy=DYNAMIC;groupDn=CN=EXAMPLE_TEAM,OU=some,OU=organizational,OU=unit,DC=example,DC=com"
}

Apply, then edit the realm_attribute string.

Expected behavior
Th edit should be persisted on the end server. Instead, the edit is not completed, and then it calculates the same edit on the next run.

Additional context
Artifactory version: 7.90.8
provider version = "~> 11.0"
terraform version = terraform 1.8.4

Findings
When trying to PATCH an LDAP group, it doesn't actually allow for you to update realm_attributes, despite what the documentation says: Updates an Access group's external ID, realm, or realm attributes.

$ curl -vvv -H "Authorization: Bearer $(jf atc | jq -r .access_token)" -XPATCH -d '{"realm_attributes": "<new-string>"}' https://artifactory.example.com/access/api/v2/groups/example_group
{
  "name" : "example_group",
  "auto_join" : false,
  "admin_privileges" : false,
  "realm" : "ldap",
  "realm_attributes" : "<original-string>",
  "members" : [ ]
}

A GET request after confirms that the realm_attributes was not edited.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requestedtriaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions