Skip to content

With the new platform_group resource I'm unable to add members that don't exist (yet) #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mojohn89 opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mojohn89
Copy link

With the new platform provider I'm unable to add a list of users that should be a member of a group, even though they haven't been created yet.

We're currently running an apply on a schedule, with validation. Previously I was able to do something like this:

resource "platform_group" "admins" {
  name             = "_admins"
  description      = "Group for Artifactory administrators"
  auto_join        = false
  admin_privileges = true
}

resource "platform_group_members" "admin_members" {
  name    = platform_group.admins.name
  members = ["member1", "member2", "member3"]
}

(rewritten for the new provider)

and on the first apply after login they were granted the permission. Now it gives this error:

 Error: Unable to Create Resource
│ 
│   with platform_group_members.admin_members,
│   on main.tf line 24, in resource "platform_group_members" "admin_members":
│   24: resource "platform_group_members" "admin_members" {
│ 
│ An unexpected error occurred while creating the resource update request. Please report this issue to the provider developers.
│ 
│ Error: Could not fetch all requested users

I would very much like to be able to define a list of users that should be granted access on the next apply, especially since I'm not able to "artificially create" users from an external user directory, in our case via OAuth.

@alexhung alexhung added the bug Something isn't working label Feb 10, 2025
@alexhung
Copy link

@mojohn89 Thanks for the report! I've added this to our plan to investigate and fix.

@alexhung
Copy link

even though they haven't been created yet.

@mojohn89 The REST API for the group does not allow for user names that don't exist in the platform. We recommend you use artifactory_user (or the other user resources) to create the user first, then references it with the platform_group_members.members attribute.

@alexhung alexhung assigned chukka and unassigned alexhung Feb 25, 2025
@mojohn89
Copy link
Author

mojohn89 commented Mar 5, 2025

This is a slightly irritating regression. With the old provider we were able to add a list (say a list of users that should be part of a team) and just add them directly. With the new one we have to perform a check to see if they've logged in and have a user before adding them to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants