terraform-provider-okta icon indicating copy to clipboard operation
terraform-provider-okta copied to clipboard

Import hcl triggers forceNew - okta_group_memberships

Open exitcode0 opened this issue 11 months ago • 1 comments

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

Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/okta/okta v4.8.0

Affected Resource(s)

  • okta_group_memberships

Terraform Configuration Files

locals {id = "00gg1234567890123"}
resource "okta_group_memberships" "_" {
  group_id = local.id
  users = []
}
import {
  to = okta_group_memberships._
  id = local.id
}

Expected Behavior

I can use a Import block to import a okta_group_memberships resulting in a No-Op (no change) output from Terraform Plan

Actual Behavior

  • Terraform import can throw an error if track_all_users is set and you only provide the <group_id>
  • importing a okta_group_memberships resource can trigger a forceNew on the group_id attribute

Steps to Reproduce

  1. Copy my example HCL
  2. replace the group ID in the local variable with a valid okta group ID
  3. terraform plan
  4. Note that the plan output

Important Factoids

n/a

References

  • #1897

exitcode0 avatar Mar 05 '24 23:03 exitcode0

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-705816

duytiennguyen-okta avatar Mar 12 '24 15:03 duytiennguyen-okta