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

azuread_group expected ID for import does not match documentation #1607

Open
HamsterExAstris opened this issue Jan 2, 2025 · 1 comment
Open

Comments

@HamsterExAstris
Copy link

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.10.3
on windows_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2

Affected Resource(s)

  • azuread_group

Terraform Configuration Files

import {
  to = azuread_group.contributor
  id = "47e4bdbc-a9eb-46e0-9a79-51e424c766dc"
}

resource "azuread_group" "contributor" {
  display_name            = "TestGroup"
  security_enabled        = true
}

Debug Output

https://gist.github.com/HamsterExAstris/5bc872c530e1be997ead268377b1c0f8

Panic Output

n/a

Expected Behavior

Group should be imported into Terraform state correctly when using the object ID as specified in the documentation.

Actual Behavior

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: parsing "47e4bdbc-a9eb-46e0-9a79-51e424c766dc": parsing the Group ID: the number of segments didn't match
│
│ Expected a Group ID that matched (containing 2 segments):
│
│ > /groups/groupId
│
│ However this value was provided (which was parsed into 0 segments):
│
│ > 47e4bdbc-a9eb-46e0-9a79-51e424c766dc
│
│ The following Segments are expected:
│
│ * Segment 0 - this should be the literal value "groups"
│ * Segment 1 - this should be the user specified value for this groupId [for example "groupId"]
│
│ The following Segments were parsed:
│
│ * Segment 0 - not found
│ * Segment 1 - not found
│
│
│
╵

Steps to Reproduce

  1. Create an Entra ID group.
  2. Update the above configuration with the Object ID for the new group.
  3. terraform plan

Important Factoids

n/a

References

@logikkreise
Copy link

The documentation on registry is outdated, because the docs are up to date in GitHub. The issue got fixed in #1519 but sadly the last release 3.0.2 does not include these fixes and the terraform registry relies on the last release (3.0.2 as of now) instead of main.

The issue will automatically be fixed with the new release. 🙂

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

No branches or pull requests

2 participants