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

Feat: data_okta_app_group_assignments add priority and profile to schema #2047

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

exitcode0
Copy link
Contributor

@exitcode0 exitcode0 commented Jul 23, 2024

The DataSource okta_app_group_assignments currently returns a list of Okta group IDs

The DataSource does not expose additional information that is returned in the API response
This PR adds the group's priority and profile to the DataSource to make full use of the data returned to us in the API response

The impetus for this PR is that I need to test configuration changes to a large, heavily used application where it's group assignments are managed via an external system
I have cloned the original Okta application and made the configuration changes to the new app in order to test there effects.
Due to the original applications okta_app_group assignments being managed via an external system, I was unable to determine how I could easily clone/replicate the group assignment configuration from one application to the other

While I was ultimately able to find a workaround, The updates this PR introduce to this datasource would be ideal for this usecase

data "okta_app_group_assignments" "application_a" {
  id = okta_app_saml.application_a.id
}

resource "okta_app_group_assignments" "application_b" {
  app_id = okta_app_saml.application_b.id

  dynamic "group" {
    for_each = flatten(data.okta_app_group_assignments.application_a.groups)
    content {
      id       = group.value.id
      priority = group.value.priority
      profile = jsonencode(group.value.profile)
    }
  }
}

adds "priority" and "profile" to the data_okta_app_group_assignments
data source, These attributes were already present in the API response,
this commit just exposes them to terraform
@exitcode0 exitcode0 changed the title add fields to schema of DataSource okta_app_group_assignments Feat: data_okta_app_group_assignments add priority and profile to schema Jul 24, 2024
@exitcode0
Copy link
Contributor Author

@duytiennguyen-okta I would love to get your thoughts on this PR when you have the time 🙇

@exitcode0
Copy link
Contributor Author

@monde Any chance I could trouble you for a review on this PR?

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

Successfully merging this pull request may close these issues.

1 participant