azure.managementgroups.ManagementGroup
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 Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var current = Azure.Core.GetSubscription.Invoke();
var exampleParent = new Azure.Management.Group("exampleParent", new()
{
DisplayName = "ParentGroup",
SubscriptionIds = new[]
{
current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId),
},
});
var exampleChild = new Azure.Management.Group("exampleChild", new()
{
DisplayName = "ChildGroup",
ParentManagementGroupId = exampleParent.Id,
SubscriptionIds = new[]
{
current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId),
},
});
// other subscription IDs can go here
});
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, "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
})
}
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("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
resources:
exampleParent:
type: azure:management:Group
properties:
displayName: ParentGroup
subscriptionIds:
- ${current.subscriptionId}
exampleChild:
type: azure:management:Group
properties:
displayName: ChildGroup
parentManagementGroupId: ${exampleParent.id}
subscriptionIds:
- ${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:
- Display
Name 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.
- Parent
Management stringGroup Id The ID of the Parent Management Group.
- Subscription
Ids List<string> A list of Subscription GUIDs which should be assigned to the Management Group.
- Display
Name 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.
- Parent
Management stringGroup Id The ID of the Parent Management Group.
- Subscription
Ids []string A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management StringGroup Id The ID of the Parent Management Group.
- subscription
Ids List<String> A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management stringGroup Id The ID of the Parent Management Group.
- subscription
Ids 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 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_ strgroup_ id The ID of the Parent Management Group.
- subscription_
ids Sequence[str] A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management StringGroup Id The ID of the Parent Management Group.
- subscription
Ids List<String> 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 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.
- Display
Name 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.
- Parent
Management stringGroup Id The ID of the Parent Management Group.
- Subscription
Ids List<string> A list of Subscription GUIDs which should be assigned to the Management Group.
- Display
Name 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.
- Parent
Management stringGroup Id The ID of the Parent Management Group.
- Subscription
Ids []string A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management StringGroup Id The ID of the Parent Management Group.
- subscription
Ids List<String> A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management stringGroup Id The ID of the Parent Management Group.
- subscription
Ids 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 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_ strgroup_ id The ID of the Parent Management Group.
- subscription_
ids Sequence[str] A list of Subscription GUIDs which should be assigned to the Management Group.
- display
Name 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.
- parent
Management StringGroup Id The ID of the Parent Management Group.
- subscription
Ids List<String> A list of Subscription GUIDs which should be assigned to the Management Group.
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.