All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.managementgroups.kotlin.ManagementGroupArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.managementgroups.kotlin

import com.pulumi.azure.managementgroups.ManagementGroupArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Management Group.
 * !> **Note:** Configuring `subscription_ids` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable.
 * ## Example Usage
 * 
 * ```typescript
 * 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)],
 * });
 * ```
 * ```python
 * 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])
 * ```
 * ```csharp
 * 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),
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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: {}
 * ```
 * 
 * ## Import
 * Management Groups can be imported using the `management group resource id`, e.g.
 * ```sh
 * $ pulumi import azure:managementgroups/managementGroup:ManagementGroup example /providers/Microsoft.Management/managementGroups/group1
 * ```
 * @property displayName A friendly name for this Management Group. If not specified, this will be the same as the `name`.
 * @property name 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.
 * @property parentManagementGroupId The ID of the Parent Management Group.
 * @property subscriptionIds 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
 */
public data class ManagementGroupArgs
@Deprecated(
    message = """
azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group
""",
)
constructor(
    public val displayName: Output? = null,
    public val name: Output? = null,
    public val parentManagementGroupId: Output? = null,
    public val subscriptionIds: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.managementgroups.ManagementGroupArgs =
        com.pulumi.azure.managementgroups.ManagementGroupArgs.builder()
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parentManagementGroupId(parentManagementGroupId?.applyValue({ args0 -> args0 }))
            .subscriptionIds(subscriptionIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [ManagementGroupArgs].
 */
@PulumiTagMarker
@Deprecated(
    message = """
azure.managementgroups.ManagementGroup has been deprecated in favor of azure.management.Group
""",
)
public class ManagementGroupArgsBuilder internal constructor() {
    private var displayName: Output? = null

    private var name: Output? = null

    private var parentManagementGroupId: Output? = null

    private var subscriptionIds: Output>? = null

    /**
     * @param value A friendly name for this Management Group. If not specified, this will be the same as the `name`.
     */
    @JvmName("dmrwtijordtvbqub")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value 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.
     */
    @JvmName("lseweinxtcjtykrd")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the Parent Management Group.
     */
    @JvmName("hamegpysmguwwauj")
    public suspend fun parentManagementGroupId(`value`: Output) {
        this.parentManagementGroupId = value
    }

    /**
     * @param value 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
     */
    @JvmName("okktjcyojplfsjtb")
    public suspend fun subscriptionIds(`value`: Output>) {
        this.subscriptionIds = value
    }

    @JvmName("goiprtvfnhbtcrph")
    public suspend fun subscriptionIds(vararg values: Output) {
        this.subscriptionIds = Output.all(values.asList())
    }

    /**
     * @param values 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
     */
    @JvmName("dnmomvvosfpygwhf")
    public suspend fun subscriptionIds(values: List>) {
        this.subscriptionIds = Output.all(values)
    }

    /**
     * @param value A friendly name for this Management Group. If not specified, this will be the same as the `name`.
     */
    @JvmName("ulccerrqqsgtqhpi")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("lmmyotnhwjvmylec")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the Parent Management Group.
     */
    @JvmName("wdmnhkuqnepuhqif")
    public suspend fun parentManagementGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parentManagementGroupId = mapped
    }

    /**
     * @param value 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
     */
    @JvmName("nrdrctcgghknekwa")
    public suspend fun subscriptionIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptionIds = mapped
    }

    /**
     * @param values 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
     */
    @JvmName("nrufhtmtpmylubcr")
    public suspend fun subscriptionIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subscriptionIds = mapped
    }

    internal fun build(): ManagementGroupArgs = ManagementGroupArgs(
        displayName = displayName,
        name = name,
        parentManagementGroupId = parentManagementGroupId,
        subscriptionIds = subscriptionIds,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy