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

okta_group_rule.remove_assigned_users = True fails to remove users when deleting rule #2082

Open
RGVas opened this issue Sep 12, 2024 · 2 comments · May be fixed by #2083
Open

okta_group_rule.remove_assigned_users = True fails to remove users when deleting rule #2082

RGVas opened this issue Sep 12, 2024 · 2 comments · May be fixed by #2083
Assignees
Labels
OKTA-806008 triaged Triaged into internal Jira

Comments

@RGVas
Copy link

RGVas commented Sep 12, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.9.5

Affected Resource(s)

okta_group_rule

Terraform Configuration Files

resource "okta_group_rule" "example" {
  name                  = "example"
  status                = "ACTIVE"
  group_assignments     = [okta_group_example.id]
  expression_type       = "urn:okta:expression:1.0"
  expression_value      = "String.startsWith(user.firstName,\"andy\")"
  remove_assigned_users = true
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Once the rule is deleted all users assigned by the rule should be unassigned from the group

Can this be done in the Admin UI?

I don't know

Can this be done in the actual API call?

Yes

https://developer.okta.com/docs/api/openapi/okta-management/management/tag/GroupRule/#tag/GroupRule/operation/deleteGroupRule

Actual Behavior

Users are not removed from the group set by the rule when using remove_assigned_users = true. Instead their managed status changes from "By rule" to "Manually"

Steps to Reproduce

  1. Create a group rule
  2. terraform apply
  3. Delete group rule
  4. terraform apply

Important Factoids

N/A

References

N/A

@RGVas
Copy link
Author

RGVas commented Sep 12, 2024

I've raised a PR for this here

@arvindkrishnakumar-okta
Copy link
Contributor

@RGVas Thanks for your PR! I'll review it and get it merged soon.

If not already, can you please sign the CLA here?

@arvindkrishnakumar-okta arvindkrishnakumar-okta added OKTA-806008 triaged Triaged into internal Jira labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OKTA-806008 triaged Triaged into internal Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants