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_member - group as a member in a group #1500

Open
kaplik opened this issue Sep 27, 2024 · 4 comments
Open

azuread_group_member - group as a member in a group #1500

kaplik opened this issue Sep 27, 2024 · 4 comments
Assignees

Comments

@kaplik
Copy link

kaplik commented Sep 27, 2024

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

Affected Resource(s)

  • azuread_group_member

Terraform Configuration Files

terraform {
  required_version = ">= 1.8.0"
  
  required_providers {
    azuread = {
      source  = "hashicorp/azuread"
      version = ">= 3.0.1"
    }

  }
}

provider "azuread" {
  tenant_id = "xxxxxx"
}

data "azuread_group" "this" {
  display_name     = "asd"
  security_enabled = true
}

resource "azuread_group_member" "this" {
  group_object_id  = "UUID" # existing group object id
  member_object_id = data.azuread_group.this.id
}

Debug Output

Panic Output

data.azuread_group.this: Reading...
data.azuread_group.this: Read complete after 1s [id=/groups/UUID]

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

╷
│ Error: expected "member_object_id" to be a valid UUID, got /groups/UUID
│ 
│   with azuread_group_member.this,
│   on main.tf line 16, in resource "azuread_group_member" "this":
│   16:   member_object_id = data.azuread_group.this.id
│ 
╵

Expected Behavior

worked before version 3

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@anwarnk
Copy link

anwarnk commented Sep 27, 2024

We are also experiencing this issue!

@juicybaba
Copy link

data.azuread_group.this.object_id can be a quick workaround , a number of resources return id in resource_type/UUID now, can either be a bug or expected behavior in 3.*.

@kaplik
Copy link
Author

kaplik commented Sep 27, 2024

@juicybaba yes, thanks, that works but as there is nothing in the migration guide related to this change, i went with reporting it as a bug.

@manicminer
Copy link
Member

Hi @kaplik, @juicybaba is correct, object_id is the correct attribute to use here. You are correct, this is missing from the upgrade guide - sorry for that omission, I’ll look to add this.

As a guide, where a property ends with *_object_id, you should use the object_id attribute of the corresponding resource. This was a bit inconsistent in 2.x versions but we’ve tried to tidy this up in 3.0

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

No branches or pull requests

4 participants