azuread.AdministrativeUnit
Explore with Pulumi AI
Manages an Administrative Unit within Azure Active Directory.
API Permissions
The following API permissions are required in order to use this resource.
When authenticated with a service principal, this resource requires one of the following application roles: AdministrativeUnit.ReadWrite.All
or Directory.ReadWrite.All
When authenticated with a user principal, this resource requires one of the following directory roles: Privileged Role Administrator
or Global Administrator
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const example = new azuread.AdministrativeUnit("example", {
displayName: "Example-AU",
description: "Just an example",
hiddenMembershipEnabled: false,
});
import pulumi
import pulumi_azuread as azuread
example = azuread.AdministrativeUnit("example",
display_name="Example-AU",
description="Just an example",
hidden_membership_enabled=False)
package main
import (
"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azuread.NewAdministrativeUnit(ctx, "example", &azuread.AdministrativeUnitArgs{
DisplayName: pulumi.String("Example-AU"),
Description: pulumi.String("Just an example"),
HiddenMembershipEnabled: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var example = new AzureAD.AdministrativeUnit("example", new()
{
DisplayName = "Example-AU",
Description = "Just an example",
HiddenMembershipEnabled = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.AdministrativeUnit;
import com.pulumi.azuread.AdministrativeUnitArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new AdministrativeUnit("example", AdministrativeUnitArgs.builder()
.displayName("Example-AU")
.description("Just an example")
.hiddenMembershipEnabled(false)
.build());
}
}
resources:
example:
type: azuread:AdministrativeUnit
properties:
displayName: Example-AU
description: Just an example
hiddenMembershipEnabled: false
Create AdministrativeUnit Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AdministrativeUnit(name: string, args: AdministrativeUnitArgs, opts?: CustomResourceOptions);
@overload
def AdministrativeUnit(resource_name: str,
args: AdministrativeUnitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AdministrativeUnit(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
description: Optional[str] = None,
hidden_membership_enabled: Optional[bool] = None,
members: Optional[Sequence[str]] = None,
prevent_duplicate_names: Optional[bool] = None)
func NewAdministrativeUnit(ctx *Context, name string, args AdministrativeUnitArgs, opts ...ResourceOption) (*AdministrativeUnit, error)
public AdministrativeUnit(string name, AdministrativeUnitArgs args, CustomResourceOptions? opts = null)
public AdministrativeUnit(String name, AdministrativeUnitArgs args)
public AdministrativeUnit(String name, AdministrativeUnitArgs args, CustomResourceOptions options)
type: azuread:AdministrativeUnit
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AdministrativeUnitArgs
- 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 AdministrativeUnitArgs
- 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 AdministrativeUnitArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AdministrativeUnitArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AdministrativeUnitArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var administrativeUnitResource = new AzureAD.AdministrativeUnit("administrativeUnitResource", new()
{
DisplayName = "string",
Description = "string",
HiddenMembershipEnabled = false,
Members = new[]
{
"string",
},
PreventDuplicateNames = false,
});
example, err := azuread.NewAdministrativeUnit(ctx, "administrativeUnitResource", &azuread.AdministrativeUnitArgs{
DisplayName: pulumi.String("string"),
Description: pulumi.String("string"),
HiddenMembershipEnabled: pulumi.Bool(false),
Members: pulumi.StringArray{
pulumi.String("string"),
},
PreventDuplicateNames: pulumi.Bool(false),
})
var administrativeUnitResource = new AdministrativeUnit("administrativeUnitResource", AdministrativeUnitArgs.builder()
.displayName("string")
.description("string")
.hiddenMembershipEnabled(false)
.members("string")
.preventDuplicateNames(false)
.build());
administrative_unit_resource = azuread.AdministrativeUnit("administrativeUnitResource",
display_name="string",
description="string",
hidden_membership_enabled=False,
members=["string"],
prevent_duplicate_names=False)
const administrativeUnitResource = new azuread.AdministrativeUnit("administrativeUnitResource", {
displayName: "string",
description: "string",
hiddenMembershipEnabled: false,
members: ["string"],
preventDuplicateNames: false,
});
type: azuread:AdministrativeUnit
properties:
description: string
displayName: string
hiddenMembershipEnabled: false
members:
- string
preventDuplicateNames: false
AdministrativeUnit Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AdministrativeUnit resource accepts the following input properties:
- Display
Name string - The display name of the administrative unit.
- Description string
- The description of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- Members List<string>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- Prevent
Duplicate boolNames - If
true
, will return an error if an existing administrative unit is found with the same name
- Display
Name string - The display name of the administrative unit.
- Description string
- The description of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- Members []string
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- Prevent
Duplicate boolNames - If
true
, will return an error if an existing administrative unit is found with the same name
- display
Name String - The display name of the administrative unit.
- description String
- The description of the administrative unit.
- Boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members List<String>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- prevent
Duplicate BooleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
- display
Name string - The display name of the administrative unit.
- description string
- The description of the administrative unit.
- boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members string[]
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- prevent
Duplicate booleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
- display_
name str - The display name of the administrative unit.
- description str
- The description of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members Sequence[str]
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- prevent_
duplicate_ boolnames - If
true
, will return an error if an existing administrative unit is found with the same name
- display
Name String - The display name of the administrative unit.
- description String
- The description of the administrative unit.
- Boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members List<String>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- prevent
Duplicate BooleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
Outputs
All input properties are implicitly available as output properties. Additionally, the AdministrativeUnit resource produces the following output properties:
Look up Existing AdministrativeUnit Resource
Get an existing AdministrativeUnit 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?: AdministrativeUnitState, opts?: CustomResourceOptions): AdministrativeUnit
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
hidden_membership_enabled: Optional[bool] = None,
members: Optional[Sequence[str]] = None,
object_id: Optional[str] = None,
prevent_duplicate_names: Optional[bool] = None) -> AdministrativeUnit
func GetAdministrativeUnit(ctx *Context, name string, id IDInput, state *AdministrativeUnitState, opts ...ResourceOption) (*AdministrativeUnit, error)
public static AdministrativeUnit Get(string name, Input<string> id, AdministrativeUnitState? state, CustomResourceOptions? opts = null)
public static AdministrativeUnit get(String name, Output<String> id, AdministrativeUnitState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Description string
- The description of the administrative unit.
- Display
Name string - The display name of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- Members List<string>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- Object
Id string - The object ID of the administrative unit.
- Prevent
Duplicate boolNames - If
true
, will return an error if an existing administrative unit is found with the same name
- Description string
- The description of the administrative unit.
- Display
Name string - The display name of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- Members []string
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- Object
Id string - The object ID of the administrative unit.
- Prevent
Duplicate boolNames - If
true
, will return an error if an existing administrative unit is found with the same name
- description String
- The description of the administrative unit.
- display
Name String - The display name of the administrative unit.
- Boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members List<String>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- object
Id String - The object ID of the administrative unit.
- prevent
Duplicate BooleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
- description string
- The description of the administrative unit.
- display
Name string - The display name of the administrative unit.
- boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members string[]
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- object
Id string - The object ID of the administrative unit.
- prevent
Duplicate booleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
- description str
- The description of the administrative unit.
- display_
name str - The display name of the administrative unit.
- bool
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members Sequence[str]
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- object_
id str - The object ID of the administrative unit.
- prevent_
duplicate_ boolnames - If
true
, will return an error if an existing administrative unit is found with the same name
- description String
- The description of the administrative unit.
- display
Name String - The display name of the administrative unit.
- Boolean
- Whether the administrative unit and its members are hidden or publicly viewable in the directory.
- members List<String>
A set of object IDs of members who should be present in this administrative unit. Supported object types are Users or Groups.
Caution When using the
members
property of the azuread.AdministrativeUnit resource, to manage Administrative Unit membership for a group, you will need to use anignore_changes = [administrative_unit_ids]
lifecycle meta argument for theazuread.Group
resource, in order to avoid a persistent diff.!> Warning Do not use the
members
property at the same time as the azuread.AdministrativeUnitMember resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.- object
Id String - The object ID of the administrative unit.
- prevent
Duplicate BooleanNames - If
true
, will return an error if an existing administrative unit is found with the same name
Import
Administrative units can be imported using their object ID, e.g.
$ pulumi import azuread:index/administrativeUnit:AdministrativeUnit example 00000000-0000-0000-0000-000000000000
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Active Directory (Azure AD) pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuread
Terraform Provider.