ManagementGroup

Manages a Management Group.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Azure.Core.GetSubscription.InvokeAsync());
        var exampleParent = new Azure.Management.Group("exampleParent", new Azure.Management.GroupArgs
        {
            DisplayName = "ParentGroup",
            SubscriptionIds = 
            {
                current.Apply(current => current.SubscriptionId),
            },
        });
        var exampleChild = new Azure.Management.Group("exampleChild", new Azure.Management.GroupArgs
        {
            DisplayName = "ChildGroup",
            ParentManagementGroupId = exampleParent.Id,
            SubscriptionIds = 
            {
                current.Apply(current => current.SubscriptionId),
            },
        });
        // other subscription IDs can go here
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        current, err := core.GetSubscription(ctx, nil, nil)
        if err != nil {
            return err
        }
        exampleParent, err := management.NewGroup(ctx, "exampleParent", &management.GroupArgs{
            DisplayName: pulumi.String("ParentGroup"),
            SubscriptionIds: pulumi.StringArray{
                pulumi.String(current.SubscriptionId),
            },
        })
        if err != nil {
            return err
        }
        _, err = management.NewGroup(ctx, "exampleChild", &management.GroupArgs{
            DisplayName:             pulumi.String("ChildGroup"),
            ParentManagementGroupId: exampleParent.ID(),
            SubscriptionIds: pulumi.StringArray{
                pulumi.String(current.SubscriptionId),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

current = azure.core.get_subscription()
example_parent = azure.management.Group("exampleParent",
    display_name="ParentGroup",
    subscription_ids=[current.subscription_id])
example_child = azure.management.Group("exampleChild",
    display_name="ChildGroup",
    parent_management_group_id=example_parent.id,
    subscription_ids=[current.subscription_id])
# other subscription IDs can go here
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getSubscription({});
const exampleParent = new azure.management.Group("exampleParent", {
    displayName: "ParentGroup",
    subscriptionIds: [current.then(current => current.subscriptionId)],
});
const exampleChild = new azure.management.Group("exampleChild", {
    displayName: "ChildGroup",
    parentManagementGroupId: exampleParent.id,
    subscriptionIds: [current.then(current => current.subscriptionId)],
});
// other subscription IDs can go here

Deprecated: azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group

Create a ManagementGroup Resource

def ManagementGroup(resource_name, opts=None, display_name=None, group_id=None, name=None, parent_management_group_id=None, subscription_ids=None, __props__=None);
public ManagementGroup(string name, ManagementGroupArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ManagementGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ManagementGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ManagementGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ManagementGroup Resource Properties

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

Inputs

The ManagementGroup resource accepts the following input properties:

DisplayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

GroupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

Name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

ParentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

SubscriptionIds List<string>

A list of Subscription GUIDs which should be assigned to the Management Group.

DisplayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

GroupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

Name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

ParentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

SubscriptionIds []string

A list of Subscription GUIDs which should be assigned to the Management Group.

displayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

groupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

parentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

subscriptionIds string[]

A list of Subscription GUIDs which should be assigned to the Management Group.

display_name str

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

group_id str

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

name str

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

parent_management_group_id str

The ID of the Parent Management Group. Changing this forces a new resource to be created.

subscription_ids List[str]

A list of Subscription GUIDs which should be assigned to the Management Group.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ManagementGroup Resource

Get an existing ManagementGroup 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?: ManagementGroupState, opts?: CustomResourceOptions): ManagementGroup
static get(resource_name, id, opts=None, display_name=None, group_id=None, name=None, parent_management_group_id=None, subscription_ids=None, __props__=None);
func GetManagementGroup(ctx *Context, name string, id IDInput, state *ManagementGroupState, opts ...ResourceOption) (*ManagementGroup, error)
public static ManagementGroup Get(string name, Input<string> id, ManagementGroupState? 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:

DisplayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

GroupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

Name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

ParentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

SubscriptionIds List<string>

A list of Subscription GUIDs which should be assigned to the Management Group.

DisplayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

GroupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

Name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

ParentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

SubscriptionIds []string

A list of Subscription GUIDs which should be assigned to the Management Group.

displayName string

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

groupId string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

name string

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

parentManagementGroupId string

The ID of the Parent Management Group. Changing this forces a new resource to be created.

subscriptionIds string[]

A list of Subscription GUIDs which should be assigned to the Management Group.

display_name str

A friendly name for this Management Group. If not specified, this’ll be the same as the name.

group_id str

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

Deprecated: Deprecated in favour of name

name str

The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created.

parent_management_group_id str

The ID of the Parent Management Group. Changing this forces a new resource to be created.

subscription_ids List[str]

A list of Subscription GUIDs which should be assigned to the Management Group.

Package Details

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