Skip to content
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

Moving from artifactory_group to platform_group causes some issue with member list #170

Open
5 tasks
stefan-sesser opened this issue Dec 2, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@stefan-sesser
Copy link

Describe the bug
For all artifactory_group resources in our terraform repo, I get a deprecation warning:
This resource is deprecated. Use 'platform_group' resource in the JFrog Platform provider instead.
After re-importing the group as platform_group and doing another terraform plan I see the following changes:

  platform_group.test_group will be updated in-place
  ~ resource "platform_group" "test_group" {
    - members          = [
      - "test-user",
      ] -> null
      name             = "test-group"
   ~ realm            = "internal" -> (known after apply)
   + realm_attributes = (known after apply)
      # (2 unchanged attributes hidden)
   }

According to JFrog Artifactory Terraform recommendation, I should use the artifactory_user for managing the user-group relationship.
https://registry.terraform.io/providers/jfrog/artifactory/latest/docs/guides/user_group

How can I solve this situation?

I already thought of moving the user-group relationship to platform_groups. Unfortunately, if I leave the groups argument empty, I will not get the default readers group attached to the user.

Requirements for and issue

  • A description of the bug
  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue). If this is not supplied, this issue will likely be closed without any effort expended.
resource "platform_group" "test_group" {
  name             = "test-group"
  admin_privileges = false
  auto_join        = false
}

resource "artifactory_user" "testuser" {
  admin                      = true
  disable_ui_access          = false
  email                      = "[email protected]"
  internal_password_disabled = true
  name                       = "test-user"
  profile_updatable          = true

  groups = [
    "readers",
    platform_group.test_group.name
  ]
}
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
    EnterpriseX license 7.98.8 rev 79808900
  • Your version of terraform
    Terraform v1.9.8
  • Your version of terraform provider
artifactory = {
      source  = "jfrog/artifactory"
      version = "12.5.1"
    }
    platform = {
      source  = "jfrog/platform"
      version = "1.18.2"
    }

Expected behavior
How to setup the user-group relationship correctly.

Additional context
Add any other context about the problem here.

@stefan-sesser stefan-sesser added the bug Something isn't working label Dec 2, 2024
@alexhung
Copy link
Member

alexhung commented Dec 2, 2024

Related to #169

@alexhung
Copy link
Member

alexhung commented Dec 2, 2024

@stefan-sesser Thanks for the report. I think the solution is to implement separate resources for the user-group relationship in #169.

@stefan-sesser
Copy link
Author

@alexhung Yey, this would be awesome. Thanks for your fast response.

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

2 participants