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

directory object data source fails on unexpected object type #1194

Open
chrismilson opened this issue Sep 20, 2023 · 2 comments · May be fixed by #1195
Open

directory object data source fails on unexpected object type #1194

chrismilson opened this issue Sep 20, 2023 · 2 comments · May be fixed by #1195

Comments

@chrismilson
Copy link

chrismilson commented Sep 20, 2023

Community Note

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

Terraform (and AzureAD Provider) Version

Terraform v1.3.7
on windows_amd64

  • provider registry.terraform.io/hashicorp/azuread v2.42.0

Affected Resource(s)

  • azuread_directory_object data source

Terraform Configuration Files

data "azuread_directory_object" "this" {
  object_id = ... # object type "#microsoft.graph.device"
}

Expected Behavior

I expected the code to succeed; and for the data source to have some string (not documented, so not sure what the format would be) indicating the type of the object.

Actual Behavior

The code failed with error:

╷
│ Error: unknown object type "#microsoft.graph.device" returned for directory object with ID: "..."
│ ...

Steps to Reproduce

  1. terraform plan
@chrismilson chrismilson linked a pull request Sep 20, 2023 that will close this issue
@chrismilson
Copy link
Author

We have a use case where we want to collect the users in multiple groups, however these groups may contain other directory objects that are out of our control. In the case of those objects, we want our code to ignore those objects, but in its current state, the provider throws an error, preventing us from continuing.

@chrismilson
Copy link
Author

Any progress on this? I made a quick and dirty PR that just uses the string from upstream as-is. Would be great to get a review so that I can improve the solution or get this merged.

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

Successfully merging a pull request may close this issue.

2 participants