1. Packages
  2. Azure Classic
  3. API Docs
  4. managementgroups
  5. ManagementGroup

We recommend using Azure Native.

Azure Classic v5.67.1 published on Tuesday, Feb 27, 2024 by Pulumi

azure.managementgroups.ManagementGroup

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.67.1 published on Tuesday, Feb 27, 2024 by Pulumi
    Deprecated: azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group

    Manages a Management Group.

    !> Note: Configuring subscription_ids is not supported when using the azure.management.GroupSubscriptionAssociation resource, results will be unpredictable.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Azure.Core.GetSubscription.Invoke();
    
        var exampleParent = new Azure.Management.Group("example_parent", new()
        {
            DisplayName = "ParentGroup",
            SubscriptionIds = new[]
            {
                current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId),
            },
        });
    
        var exampleChild = new Azure.Management.Group("example_child", new()
        {
            DisplayName = "ChildGroup",
            ParentManagementGroupId = exampleParent.Id,
            SubscriptionIds = new[]
            {
                current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId),
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := core.LookupSubscription(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleParent, err := management.NewGroup(ctx, "example_parent", &management.GroupArgs{
    			DisplayName: pulumi.String("ParentGroup"),
    			SubscriptionIds: pulumi.StringArray{
    				*pulumi.String(current.SubscriptionId),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = management.NewGroup(ctx, "example_child", &management.GroupArgs{
    			DisplayName:             pulumi.String("ChildGroup"),
    			ParentManagementGroupId: exampleParent.ID(),
    			SubscriptionIds: pulumi.StringArray{
    				*pulumi.String(current.SubscriptionId),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.CoreFunctions;
    import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
    import com.pulumi.azure.management.Group;
    import com.pulumi.azure.management.GroupArgs;
    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) {
            final var current = CoreFunctions.getSubscription();
    
            var exampleParent = new Group("exampleParent", GroupArgs.builder()        
                .displayName("ParentGroup")
                .subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.subscriptionId()))
                .build());
    
            var exampleChild = new Group("exampleChild", GroupArgs.builder()        
                .displayName("ChildGroup")
                .parentManagementGroupId(exampleParent.id())
                .subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.subscriptionId()))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    current = azure.core.get_subscription()
    example_parent = azure.management.Group("example_parent",
        display_name="ParentGroup",
        subscription_ids=[current.subscription_id])
    example_child = azure.management.Group("example_child",
        display_name="ChildGroup",
        parent_management_group_id=example_parent.id,
        subscription_ids=[current.subscription_id])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const current = azure.core.getSubscription({});
    const exampleParent = new azure.management.Group("example_parent", {
        displayName: "ParentGroup",
        subscriptionIds: [current.then(current => current.subscriptionId)],
    });
    const exampleChild = new azure.management.Group("example_child", {
        displayName: "ChildGroup",
        parentManagementGroupId: exampleParent.id,
        subscriptionIds: [current.then(current => current.subscriptionId)],
    });
    
    resources:
      exampleParent:
        type: azure:management:Group
        name: example_parent
        properties:
          displayName: ParentGroup
          subscriptionIds:
            - ${current.subscriptionId}
      exampleChild:
        type: azure:management:Group
        name: example_child
        properties:
          displayName: ChildGroup
          parentManagementGroupId: ${exampleParent.id}
          subscriptionIds: # other subscription IDs can go here
            - ${current.subscriptionId}
    variables:
      current:
        fn::invoke:
          Function: azure:core:getSubscription
          Arguments: {}
    

    Create ManagementGroup Resource

    new ManagementGroup(name: string, args?: ManagementGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ManagementGroup(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        display_name: Optional[str] = None,
                        name: Optional[str] = None,
                        parent_management_group_id: Optional[str] = None,
                        subscription_ids: Optional[Sequence[str]] = None)
    @overload
    def ManagementGroup(resource_name: str,
                        args: Optional[ManagementGroupArgs] = None,
                        opts: Optional[ResourceOptions] = None)
    func NewManagementGroup(ctx *Context, name string, args *ManagementGroupArgs, opts ...ResourceOption) (*ManagementGroup, error)
    public ManagementGroup(string name, ManagementGroupArgs? args = null, CustomResourceOptions? opts = null)
    public ManagementGroup(String name, ManagementGroupArgs args)
    public ManagementGroup(String name, ManagementGroupArgs args, CustomResourceOptions options)
    
    type: azure:managementgroups:ManagementGroup
    properties: # The arguments to resource properties.
    options: # 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.
    resource_name str
    The unique name of the resource.
    args ManagementGroupArgs
    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 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.
    name String
    The unique name of the resource.
    args ManagementGroupArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts docs.

    Inputs

    The ManagementGroup resource accepts the following input properties:

    DisplayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    SubscriptionIds List<string>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    DisplayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    SubscriptionIds []string

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName String
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds List<String>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds string[]

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    display_name str
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscription_ids Sequence[str]

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName String
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds List<String>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            display_name: Optional[str] = None,
            name: Optional[str] = None,
            parent_management_group_id: Optional[str] = None,
            subscription_ids: Optional[Sequence[str]] = None) -> ManagementGroup
    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)
    public static ManagementGroup get(String name, Output<String> id, ManagementGroupState 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.
    The following state arguments are supported:
    DisplayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    SubscriptionIds List<string>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    DisplayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    SubscriptionIds []string

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName String
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds List<String>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName string
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds string[]

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    display_name str
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscription_ids Sequence[str]

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    displayName String
    A friendly name for this Management Group. If not specified, this will be the same as the 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.
    subscriptionIds List<String>

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

    Note: To clear all Subscriptions from the Management Group set subscription_ids to an empty list

    Import

    Management Groups can be imported using the management group resource id, e.g.

    $ pulumi import azure:managementgroups/managementGroup:ManagementGroup example /providers/Microsoft.Management/managementGroups/group1
    

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.67.1 published on Tuesday, Feb 27, 2024 by Pulumi