Group

Manages a Group within Azure Active Directory.

NOTE: If you’re authenticating using a Service Principal then it must have permissions to Read and write all groups within the Windows Azure Active Directory API. In addition it must also have either the Company Administrator or User Account Administrator Azure Active Directory roles assigned in order to be able to delete groups. You can assign one of the required Azure Active Directory Roles with the AzureAD PowerShell Module, which is available for Windows PowerShell or in the Azure Cloud Shell. Please refer to this documentation for more details.

Example Usage

using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AzureAD.Group("example", new AzureAD.GroupArgs
        {
            DisplayName = "A-AD-Group",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-azuread/sdk/v4/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := azuread.NewGroup(ctx, "example", &azuread.GroupArgs{
			DisplayName: pulumi.String("A-AD-Group"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_azuread as azuread

example = azuread.Group("example", display_name="A-AD-Group")
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = new azuread.Group("example", {
    displayName: "A-AD-Group",
});

Create a Group Resource

new Group(name: string, args?: GroupArgs, opts?: CustomResourceOptions);
@overload
def Group(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          description: Optional[str] = None,
          display_name: Optional[str] = None,
          members: Optional[Sequence[str]] = None,
          name: Optional[str] = None,
          owners: Optional[Sequence[str]] = None,
          prevent_duplicate_names: Optional[bool] = None)
@overload
def Group(resource_name: str,
          args: Optional[GroupArgs] = None,
          opts: Optional[ResourceOptions] = None)
func NewGroup(ctx *Context, name string, args *GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Group Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Group resource accepts the following input properties:

Description string
The description for the Group. Changing this forces a new resource to be created.
DisplayName string
The display name for the Group. Changing this forces a new resource to be created.
Members List<string>
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
Name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

Owners List<string>
A set of owners who own this Group. Supported Object types are Users or Service Principals.
PreventDuplicateNames bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.
Description string
The description for the Group. Changing this forces a new resource to be created.
DisplayName string
The display name for the Group. Changing this forces a new resource to be created.
Members []string
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
Name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

Owners []string
A set of owners who own this Group. Supported Object types are Users or Service Principals.
PreventDuplicateNames bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.
description string
The description for the Group. Changing this forces a new resource to be created.
displayName string
The display name for the Group. Changing this forces a new resource to be created.
members string[]
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

owners string[]
A set of owners who own this Group. Supported Object types are Users or Service Principals.
preventDuplicateNames boolean
If true, will return an error when an existing Group is found with the same name. Defaults to false.
description str
The description for the Group. Changing this forces a new resource to be created.
display_name str
The display name for the Group. Changing this forces a new resource to be created.
members Sequence[str]
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
name str

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

owners Sequence[str]
A set of owners who own this Group. Supported Object types are Users or Service Principals.
prevent_duplicate_names bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the Group resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
MailEnabled bool
Whether the group is mail-enabled.
ObjectId string
The Object ID of the Group.
SecurityEnabled bool
Whether the group is a security group.
Id string
The provider-assigned unique ID for this managed resource.
MailEnabled bool
Whether the group is mail-enabled.
ObjectId string
The Object ID of the Group.
SecurityEnabled bool
Whether the group is a security group.
id string
The provider-assigned unique ID for this managed resource.
mailEnabled boolean
Whether the group is mail-enabled.
objectId string
The Object ID of the Group.
securityEnabled boolean
Whether the group is a security group.
id str
The provider-assigned unique ID for this managed resource.
mail_enabled bool
Whether the group is mail-enabled.
object_id str
The Object ID of the Group.
security_enabled bool
Whether the group is a security group.

Look up an Existing Group Resource

Get an existing Group resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GroupState, opts?: CustomResourceOptions): Group
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        mail_enabled: Optional[bool] = None,
        members: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        object_id: Optional[str] = None,
        owners: Optional[Sequence[str]] = None,
        prevent_duplicate_names: Optional[bool] = None,
        security_enabled: Optional[bool] = None) -> Group
func GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)
public static Group Get(string name, Input<string> id, GroupState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Description string
The description for the Group. Changing this forces a new resource to be created.
DisplayName string
The display name for the Group. Changing this forces a new resource to be created.
MailEnabled bool
Whether the group is mail-enabled.
Members List<string>
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
Name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

ObjectId string
The Object ID of the Group.
Owners List<string>
A set of owners who own this Group. Supported Object types are Users or Service Principals.
PreventDuplicateNames bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.
SecurityEnabled bool
Whether the group is a security group.
Description string
The description for the Group. Changing this forces a new resource to be created.
DisplayName string
The display name for the Group. Changing this forces a new resource to be created.
MailEnabled bool
Whether the group is mail-enabled.
Members []string
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
Name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

ObjectId string
The Object ID of the Group.
Owners []string
A set of owners who own this Group. Supported Object types are Users or Service Principals.
PreventDuplicateNames bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.
SecurityEnabled bool
Whether the group is a security group.
description string
The description for the Group. Changing this forces a new resource to be created.
displayName string
The display name for the Group. Changing this forces a new resource to be created.
mailEnabled boolean
Whether the group is mail-enabled.
members string[]
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
name string

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

objectId string
The Object ID of the Group.
owners string[]
A set of owners who own this Group. Supported Object types are Users or Service Principals.
preventDuplicateNames boolean
If true, will return an error when an existing Group is found with the same name. Defaults to false.
securityEnabled boolean
Whether the group is a security group.
description str
The description for the Group. Changing this forces a new resource to be created.
display_name str
The display name for the Group. Changing this forces a new resource to be created.
mail_enabled bool
Whether the group is mail-enabled.
members Sequence[str]
A set of members who should be present in this Group. Supported Object types are Users, Groups or Service Principals.
name str

Deprecated: This property has been renamed to display_name and will be removed in v2.0 of this provider.

object_id str
The Object ID of the Group.
owners Sequence[str]
A set of owners who own this Group. Supported Object types are Users or Service Principals.
prevent_duplicate_names bool
If true, will return an error when an existing Group is found with the same name. Defaults to false.
security_enabled bool
Whether the group is a security group.

Import

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

 $ pulumi import azuread:index/group:Group my_group 00000000-0000-0000-0000-000000000000

Package Details

Repository
https://github.com/pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.