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

Add new resource azuread_group_owner for add owner to group #1314

Open
abtris opened this issue Feb 22, 2024 · 1 comment
Open

Add new resource azuread_group_owner for add owner to group #1314

abtris opened this issue Feb 22, 2024 · 1 comment

Comments

@abtris
Copy link

abtris commented Feb 22, 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

Description

Add equivalent for az ad group owner add as azuread_group_owner.

I think we need way how to modify owners not just members of groups. API exists and used by AZ CLI.

New or Affected Resource(s)

  • azuread_group_member
  • azuread_group_owner

Potential Terraform Configuration

resource "azuread_group_owner" "example" {
  group_object_id  = azuread_group.example.id
  owner_object_id = data.azuread_user.example.id
}

or

resource "azuread_group_member" "example" {
  group_object_id  = azuread_group.example.id
  owner_object_id = data.azuread_user.example.id
}

References

  • #0000
@dszakallas
Copy link

A workaround for the time being:

resource "terraform_data" "owner" {
  triggers_replace = [
    data.azuread_group.the_group.id,
    data.azuread_service_principal.the_user.id
  ]
  input = {
    group_id = data.azuread_group.the_group.id
    owner_id = data.azuread_service_principal.the_user.id
  }
  provisioner "local-exec" {
    command = "az ad group owner add --group ${self.input.group_id} --owner-object-id ${self.input.owner_id}"
  }
  provisioner "local-exec" {
    when    = destroy
    command = "az ad group owner remove --group ${self.input.group_id} --owner-object-id ${self.input.owner_id}"
  }
}

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

3 participants