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

Fixed constant change-loops in the 'okta_app_group_assignments' resource #644

Merged
merged 2 commits into from
Sep 14, 2021

Conversation

bogdanprodan-okta
Copy link
Contributor

Fix #611

For Terraform v1.0.6

  1. Create several groups:
resource "okta_group" "this" {
  count = 5
  name        = "testAcc_${count.index}"
  description = "testAcc_${count.index}"
}
  1. Read these groups into the data-source, create app and assign these gro
data "okta_groups" "test" {
  q = "testAcc_"
}

resource "okta_app_oauth" "test" {
  label          = "testAcc_replace_with_uuid"
  type           = "web"
  grant_types    = ["implicit", "authorization_code"]
  redirect_uris  = ["http://d.com/"]
  response_types = ["code", "token", "id_token"]
  issuer_mode    = "ORG_URL"

  lifecycle {
    ignore_changes = [users, groups]
  }
}

resource "okta_app_group_assignments" "saml" {
  app_id = okta_app_oauth.test.id

  dynamic "group" {
    for_each = data.okta_groups.test.groups

    content {
      id       = group.value.id
      priority = try(group.key+1, null)
      profile  = try(jsonencode(group.value.profile), "{}")
    }
  }
}

Running terraform apply several times shows No changes. Your infrastructure matches the configuration.

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.

Exists Change Loop for okta_app_group_assignments
2 participants