» azuread_group

Manages a Group within Azure Active Directory.

» Example Usage

Basic example

resource "azuread_group" "example" {
  name = "A-AD-Group"
}

A group with members

resource "azuread_user" "example" {
  display_name          = "J Doe"
  password              = "notSecure123"
  user_principal_name   = "jdoe@hashicorp.com"
}

resource "azuread_group" "example" {
  name    = "MyGroup"
  members = [
    azuread_user.example.object_id,
    /* more users */
  ]
}

» Argument Reference

The following arguments are supported:

  • name - (Required) The display name for the Group. Changing this forces a new resource to be created.
  • description - (Optional) The description for the Group. Changing this forces a new resource to be created.
  • members (Optional) A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
  • owners (Optional) A set of owners who own this Group. Supported Object types are Users or Service Principals.
  • prevent_duplicate_names - (Optional) If true, will return an error when an existing Group is found with the same name. Defaults to false.

» Attributes Reference

The following attributes are exported:

  • id - The Object ID of the Group.

» Import

Azure Active Directory Groups can be imported using the object id, e.g.

terraform import azuread_group.my_group 00000000-0000-0000-0000-000000000000