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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get the actual ocid user on the identity_users_data_source #2147

Open
ajdurr opened this issue Jun 26, 2024 · 0 comments
Open

Unable to get the actual ocid user on the identity_users_data_source #2147

ajdurr opened this issue Jun 26, 2024 · 0 comments
Labels

Comments

@ajdurr
Copy link

ajdurr commented Jun 26, 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 "me too" comments, 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 and Provider Version

Terraform v1.8.0
on windows_amd64

  • provider registry.terraform.io/hashicorp/oci v5.47.0

Affected Resource(s)

affected_data_source = oci_identity_users

Terraform Configuration Files

# Fetch list of users
data "oci_identity_users" "users" {
  for_each = toset(var.user_names)
  compartment_id = var.tenancy_ocid

  filter {
    name         = "name"
    values       = [each.value]
  }
}

resource "oci_identity_user_group_membership" "group_membership" {
    for_each = { for idx, user in data.oci_identity_users.users : idx => user }
    #Required
    group_id = oci_identity_group.group.id
    user_id = each.value.id
}

Plan snippit output

 + resource "oci_identity_user_group_membership" "group_membership" {
      + compartment_id = (known after apply)
      + group_id       = "ocid1.group.oc1..aaaaaaaaoh"
      + id             = (known after apply)
      + inactive_state = (known after apply)
      + state          = (known after apply)
      + time_created   = (known after apply)
      + user_id        = "IdentityUsersDataSource-182991342"
    }

Expected Behavior

Return a ocid User

Actual Behavior

Returns a bogus ID "IdentityUsersDataSource-1829913042"

Steps to Reproduce

  1. terraform apply

References

https://github.com/oracle/oci-go-sdk/blob/master/identity/list_users_request_response.go

https://github.com/oracle/terraform-provider-oci/blob/master/internal/service/identity/identity_users_data_source.go

https://docs.oracle.com/en-us/iaas/tools/dotnet/89.2.0/api/Oci.IdentityService.Requests.ListUsersRequest.html

https://discuss.hashicorp.com/t/hi-i-need-to-get-data-source-for-oci-identity-user/53872

@ajdurr ajdurr added the bug label Jun 26, 2024
@ajdurr ajdurr changed the title Unable to get the real ocid user on the identity_users_data_source Unable to get the actual ocid user on the identity_users_data_source Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant