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

com.pulumi.azure.lab.kotlin.ServicePlanArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.lab.kotlin

import com.pulumi.azure.lab.ServicePlanArgs.builder
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanDefaultAutoShutdownArgs
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanDefaultAutoShutdownArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanDefaultConnectionArgs
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanDefaultConnectionArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanSupportArgs
import com.pulumi.azure.lab.kotlin.inputs.ServicePlanSupportArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Lab Service Plan.
 * > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleServicePlan = new azure.lab.ServicePlan("example", {
 *     name: "example-lp",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     allowedRegions: [example.location],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_service_plan = azure.lab.ServicePlan("example",
 *     name="example-lp",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     allowed_regions=[example.location])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleServicePlan = new Azure.Lab.ServicePlan("example", new()
 *     {
 *         Name = "example-lp",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AllowedRegions = new[]
 *         {
 *             example.Location,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lab.NewServicePlan(ctx, "example", &lab.ServicePlanArgs{
 * 			Name:              pulumi.String("example-lp"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			AllowedRegions: pulumi.StringArray{
 * 				example.Location,
 * 			},
 * 		})
 * 		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.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.lab.ServicePlan;
 * import com.pulumi.azure.lab.ServicePlanArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleServicePlan = new ServicePlan("exampleServicePlan", ServicePlanArgs.builder()
 *             .name("example-lp")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .allowedRegions(example.location())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleServicePlan:
 *     type: azure:lab:ServicePlan
 *     name: example
 *     properties:
 *       name: example-lp
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       allowedRegions:
 *         - ${example.location}
 * ```
 * 
 * ## Import
 * Lab Service Plans can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lab/servicePlan:ServicePlan example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labPlans/labPlan1
 * ```
 * @property allowedRegions The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between `1` and `28`.
 * @property defaultAutoShutdown A `default_auto_shutdown` block as defined below.
 * @property defaultConnection A `default_connection` block as defined below.
 * @property defaultNetworkSubnetId The resource ID of the Subnet for the Lab Service Plan network profile.
 * @property location The Azure Region where the Lab Service Plan should exist. Changing this forces a new resource to be created.
 * @property name The name of the Lab Service Plan. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group where the Lab Service Plan should exist. Changing this forces a new resource to be created.
 * @property sharedGalleryId The resource ID of the Shared Image Gallery attached to this Lab Service Plan. When saving a lab template virtual machine image it will be persisted in this gallery. The shared images from the gallery can be made available to use when creating new labs.
 * > **NOTE:** The built-in `Azure Lab Services` Service Principal with role needs to be assigned to the Shared Image Gallery while using this property.
 * @property support A `support` block as defined below.
 * @property tags A mapping of tags which should be assigned to the Lab Service Plan.
 */
public data class ServicePlanArgs(
    public val allowedRegions: Output>? = null,
    public val defaultAutoShutdown: Output? = null,
    public val defaultConnection: Output? = null,
    public val defaultNetworkSubnetId: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sharedGalleryId: Output? = null,
    public val support: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lab.ServicePlanArgs =
        com.pulumi.azure.lab.ServicePlanArgs.builder()
            .allowedRegions(allowedRegions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .defaultAutoShutdown(
                defaultAutoShutdown?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .defaultConnection(defaultConnection?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .defaultNetworkSubnetId(defaultNetworkSubnetId?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sharedGalleryId(sharedGalleryId?.applyValue({ args0 -> args0 }))
            .support(support?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ServicePlanArgs].
 */
@PulumiTagMarker
public class ServicePlanArgsBuilder internal constructor() {
    private var allowedRegions: Output>? = null

    private var defaultAutoShutdown: Output? = null

    private var defaultConnection: Output? = null

    private var defaultNetworkSubnetId: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var sharedGalleryId: Output? = null

    private var support: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between `1` and `28`.
     */
    @JvmName("uunanhtarhvpaerk")
    public suspend fun allowedRegions(`value`: Output>) {
        this.allowedRegions = value
    }

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

    /**
     * @param values The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between `1` and `28`.
     */
    @JvmName("odasfrqortwelrip")
    public suspend fun allowedRegions(values: List>) {
        this.allowedRegions = Output.all(values)
    }

    /**
     * @param value A `default_auto_shutdown` block as defined below.
     */
    @JvmName("mqjfnaemcbkanefj")
    public suspend fun defaultAutoShutdown(`value`: Output) {
        this.defaultAutoShutdown = value
    }

    /**
     * @param value A `default_connection` block as defined below.
     */
    @JvmName("ojgthaamuthhdfpx")
    public suspend fun defaultConnection(`value`: Output) {
        this.defaultConnection = value
    }

    /**
     * @param value The resource ID of the Subnet for the Lab Service Plan network profile.
     */
    @JvmName("trshcdfcpwwlfvah")
    public suspend fun defaultNetworkSubnetId(`value`: Output) {
        this.defaultNetworkSubnetId = value
    }

    /**
     * @param value The Azure Region where the Lab Service Plan should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ssocrloywwpkxntl")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the Lab Service Plan. Changing this forces a new resource to be created.
     */
    @JvmName("aeyskktodwwigvds")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the Resource Group where the Lab Service Plan should exist. Changing this forces a new resource to be created.
     */
    @JvmName("nfmqxagncaupugym")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The resource ID of the Shared Image Gallery attached to this Lab Service Plan. When saving a lab template virtual machine image it will be persisted in this gallery. The shared images from the gallery can be made available to use when creating new labs.
     * > **NOTE:** The built-in `Azure Lab Services` Service Principal with role needs to be assigned to the Shared Image Gallery while using this property.
     */
    @JvmName("yabpbrjwxjwallgg")
    public suspend fun sharedGalleryId(`value`: Output) {
        this.sharedGalleryId = value
    }

    /**
     * @param value A `support` block as defined below.
     */
    @JvmName("vojxdoebonrxcotc")
    public suspend fun support(`value`: Output) {
        this.support = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Lab Service Plan.
     */
    @JvmName("ahxthodwyrtbjbnc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between `1` and `28`.
     */
    @JvmName("ayjhmvrpktjjoore")
    public suspend fun allowedRegions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowedRegions = mapped
    }

    /**
     * @param values The allowed regions for the lab creator to use when creating labs using this Lab Service Plan. The allowed region's count must be between `1` and `28`.
     */
    @JvmName("exkppptgtugdnyov")
    public suspend fun allowedRegions(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.allowedRegions = mapped
    }

    /**
     * @param value A `default_auto_shutdown` block as defined below.
     */
    @JvmName("wspqpycjovnpqrbf")
    public suspend fun defaultAutoShutdown(`value`: ServicePlanDefaultAutoShutdownArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultAutoShutdown = mapped
    }

    /**
     * @param argument A `default_auto_shutdown` block as defined below.
     */
    @JvmName("yvvdqgfbkyxawawp")
    public suspend
    fun defaultAutoShutdown(argument: suspend ServicePlanDefaultAutoShutdownArgsBuilder.() -> Unit) {
        val toBeMapped = ServicePlanDefaultAutoShutdownArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.defaultAutoShutdown = mapped
    }

    /**
     * @param value A `default_connection` block as defined below.
     */
    @JvmName("skhilqnqllhumheb")
    public suspend fun defaultConnection(`value`: ServicePlanDefaultConnectionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultConnection = mapped
    }

    /**
     * @param argument A `default_connection` block as defined below.
     */
    @JvmName("ogamnnaaiyhnbwyh")
    public suspend
    fun defaultConnection(argument: suspend ServicePlanDefaultConnectionArgsBuilder.() -> Unit) {
        val toBeMapped = ServicePlanDefaultConnectionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.defaultConnection = mapped
    }

    /**
     * @param value The resource ID of the Subnet for the Lab Service Plan network profile.
     */
    @JvmName("nxqnwjplhlytwimq")
    public suspend fun defaultNetworkSubnetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultNetworkSubnetId = mapped
    }

    /**
     * @param value The Azure Region where the Lab Service Plan should exist. Changing this forces a new resource to be created.
     */
    @JvmName("delmkffpevtskfjd")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name of the Lab Service Plan. Changing this forces a new resource to be created.
     */
    @JvmName("eckqpexbefimbcrr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the Resource Group where the Lab Service Plan should exist. Changing this forces a new resource to be created.
     */
    @JvmName("qlvvsbnagihskroq")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The resource ID of the Shared Image Gallery attached to this Lab Service Plan. When saving a lab template virtual machine image it will be persisted in this gallery. The shared images from the gallery can be made available to use when creating new labs.
     * > **NOTE:** The built-in `Azure Lab Services` Service Principal with role needs to be assigned to the Shared Image Gallery while using this property.
     */
    @JvmName("whqjgmapmpgxchnq")
    public suspend fun sharedGalleryId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sharedGalleryId = mapped
    }

    /**
     * @param value A `support` block as defined below.
     */
    @JvmName("qqjhbsomxwsrviag")
    public suspend fun support(`value`: ServicePlanSupportArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.support = mapped
    }

    /**
     * @param argument A `support` block as defined below.
     */
    @JvmName("fomprrgaswdvitro")
    public suspend fun support(argument: suspend ServicePlanSupportArgsBuilder.() -> Unit) {
        val toBeMapped = ServicePlanSupportArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.support = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Lab Service Plan.
     */
    @JvmName("mrkkyevrxevumauf")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Lab Service Plan.
     */
    @JvmName("ltlyovvisvatholu")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ServicePlanArgs = ServicePlanArgs(
        allowedRegions = allowedRegions,
        defaultAutoShutdown = defaultAutoShutdown,
        defaultConnection = defaultConnection,
        defaultNetworkSubnetId = defaultNetworkSubnetId,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        sharedGalleryId = sharedGalleryId,
        support = support,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy