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

Configuration profile computer group IDs ordering #254

Closed
w0de opened this issue May 24, 2024 · 2 comments · May be fixed by #600
Closed

Configuration profile computer group IDs ordering #254

w0de opened this issue May 24, 2024 · 2 comments · May be fixed by #600
Assignees

Comments

@w0de
Copy link
Contributor

w0de commented May 24, 2024

I believe configuration profiles' assign computer group IDs are sorted in the API response by group ID. This diff should be suppressed.

Eg:

  # jamfpro_macos_configuration_profile.munki_shard_1 will be updated in-place
  ~ resource "jamfpro_macos_configuration_profile" "munki_shard_1" {
        id                  = "165"
        name                = "Munki - Shard 1"
        # (4 unchanged attributes hidden)

      ~ scope {
          ~ computer_group_ids = [
              - 126,
                70,
              + 126,
            ]
            # (7 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

  # jamfpro_macos_configuration_profile.munki_shard_2 will be updated in-place
  ~ resource "jamfpro_macos_configuration_profile" "munki_shard_2" {
        id                  = "163"
        name                = "Munki - Shard 2"
        # (4 unchanged attributes hidden)

      ~ scope {
            # (8 unchanged attributes hidden)

          ~ exclusions {
              ~ computer_group_ids  = [
                  - 126,
                    68,
                    # (1 unchanged element hidden)
                    123,
                  + 126,
                ]
                # (7 unchanged attributes hidden)
            }
        }

        # (1 unchanged block hidden)
    }

  # jamfpro_macos_configuration_profile.munki_shard_3 will be updated in-place
  ~ resource "jamfpro_macos_configuration_profile" "munki_shard_3" {
        id                  = "164"
        name                = "Munki - Shard 3"
        # (4 unchanged attributes hidden)

      ~ scope {
            # (8 unchanged attributes hidden)

          ~ exclusions {
              ~ computer_group_ids  = [
                  - 126,
                    68,
                    # (1 unchanged element hidden)
                    123,
                  + 126,
                ]
                # (7 unchanged attributes hidden)
            }
        }

        # (1 unchanged block hidden)
    }

  # jamfpro_macos_configuration_profile.munki_shard_4 will be updated in-place
  ~ resource "jamfpro_macos_configuration_profile" "munki_shard_4" {
        id                  = "167"
        name                = "Munki - Shard 4"
        # (4 unchanged attributes hidden)

      ~ scope {
            # (8 unchanged attributes hidden)

          ~ exclusions {
              ~ computer_group_ids  = [
                  - 126,
                    68,
                    # (1 unchanged element hidden)
                    123,
                  + 126,
                ]
                # (7 unchanged attributes hidden)
            }
        }

        # (1 unchanged block hidden)
    }

  # jamfpro_macos_configuration_profile.munki_shard_5 will be updated in-place
  ~ resource "jamfpro_macos_configuration_profile" "munki_shard_5" {
        id                  = "166"
        name                = "Munki - Shard 5"
        # (4 unchanged attributes hidden)

      ~ scope {
            # (8 unchanged attributes hidden)

          ~ exclusions {
              ~ computer_group_ids  = [
                  - 126,
                    68,
                    # (1 unchanged element hidden)
                    123,
                  + 126,
                ]
                # (7 unchanged attributes hidden)
            }
        }

        # (1 unchanged block hidden)
    }
@thejoeker12
Copy link
Contributor

thejoeker12 commented May 24, 2024

Jamf will return in ascending order regardless of how we send them. Supressing this difference is tricky due to how TF Provider SDKv2 executes the diff suppress func and which args it provides.

It's on the list of things to fix in the future but for now, please wrap your id list in sort() to avoid having this issue.

computer_ids = sort([1, 3, 2])

@thejoeker12 thejoeker12 self-assigned this May 24, 2024
@w0de
Copy link
Contributor Author

w0de commented May 25, 2024

Yes but then I have to write a module 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants