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

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

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

package com.pulumi.azure.lab.kotlin

import com.pulumi.azure.lab.LabArgs.builder
import com.pulumi.azure.lab.kotlin.inputs.LabAutoShutdownArgs
import com.pulumi.azure.lab.kotlin.inputs.LabAutoShutdownArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.LabConnectionSettingArgs
import com.pulumi.azure.lab.kotlin.inputs.LabConnectionSettingArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.LabNetworkArgs
import com.pulumi.azure.lab.kotlin.inputs.LabNetworkArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.LabRosterArgs
import com.pulumi.azure.lab.kotlin.inputs.LabRosterArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.LabSecurityArgs
import com.pulumi.azure.lab.kotlin.inputs.LabSecurityArgsBuilder
import com.pulumi.azure.lab.kotlin.inputs.LabVirtualMachineArgs
import com.pulumi.azure.lab.kotlin.inputs.LabVirtualMachineArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * Manages a Lab Service Lab.
 * !> **Note:** This resource is being [deprecated by Azure](https://learn.microsoft.com/en-us/azure/lab-services/retirement-guide). This resource will be removed in version 4.0 of the provider.
 * ## 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 exampleLab = new azure.lab.Lab("example", {
 *     name: "example-lab",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     title: "Test Title",
 *     security: {
 *         openAccessEnabled: false,
 *     },
 *     virtualMachine: {
 *         adminUser: {
 *             username: "testadmin",
 *             password: "Password1234!",
 *         },
 *         imageReference: {
 *             publisher: "Canonical",
 *             offer: "0001-com-ubuntu-server-jammy",
 *             sku: "22_04-lts",
 *             version: "latest",
 *         },
 *         sku: {
 *             name: "Classic_Fsv2_2_4GB_128_S_SSD",
 *             capacity: 0,
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_lab = azure.lab.Lab("example",
 *     name="example-lab",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     title="Test Title",
 *     security={
 *         "open_access_enabled": False,
 *     },
 *     virtual_machine={
 *         "admin_user": {
 *             "username": "testadmin",
 *             "password": "Password1234!",
 *         },
 *         "image_reference": {
 *             "publisher": "Canonical",
 *             "offer": "0001-com-ubuntu-server-jammy",
 *             "sku": "22_04-lts",
 *             "version": "latest",
 *         },
 *         "sku": {
 *             "name": "Classic_Fsv2_2_4GB_128_S_SSD",
 *             "capacity": 0,
 *         },
 *     })
 * ```
 * ```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 exampleLab = new Azure.Lab.Lab("example", new()
 *     {
 *         Name = "example-lab",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Title = "Test Title",
 *         Security = new Azure.Lab.Inputs.LabSecurityArgs
 *         {
 *             OpenAccessEnabled = false,
 *         },
 *         VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs
 *         {
 *             AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs
 *             {
 *                 Username = "testadmin",
 *                 Password = "Password1234!",
 *             },
 *             ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs
 *             {
 *                 Publisher = "Canonical",
 *                 Offer = "0001-com-ubuntu-server-jammy",
 *                 Sku = "22_04-lts",
 *                 Version = "latest",
 *             },
 *             Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs
 *             {
 *                 Name = "Classic_Fsv2_2_4GB_128_S_SSD",
 *                 Capacity = 0,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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.NewLab(ctx, "example", &lab.LabArgs{
 * 			Name:              pulumi.String("example-lab"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Title:             pulumi.String("Test Title"),
 * 			Security: &lab.LabSecurityArgs{
 * 				OpenAccessEnabled: pulumi.Bool(false),
 * 			},
 * 			VirtualMachine: &lab.LabVirtualMachineArgs{
 * 				AdminUser: &lab.LabVirtualMachineAdminUserArgs{
 * 					Username: pulumi.String("testadmin"),
 * 					Password: pulumi.String("Password1234!"),
 * 				},
 * 				ImageReference: &lab.LabVirtualMachineImageReferenceArgs{
 * 					Publisher: pulumi.String("Canonical"),
 * 					Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
 * 					Sku:       pulumi.String("22_04-lts"),
 * 					Version:   pulumi.String("latest"),
 * 				},
 * 				Sku: &lab.LabVirtualMachineSkuArgs{
 * 					Name:     pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"),
 * 					Capacity: pulumi.Int(0),
 * 				},
 * 			},
 * 		})
 * 		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.Lab;
 * import com.pulumi.azure.lab.LabArgs;
 * import com.pulumi.azure.lab.inputs.LabSecurityArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineAdminUserArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineImageReferenceArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineSkuArgs;
 * 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 exampleLab = new Lab("exampleLab", LabArgs.builder()
 *             .name("example-lab")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .title("Test Title")
 *             .security(LabSecurityArgs.builder()
 *                 .openAccessEnabled(false)
 *                 .build())
 *             .virtualMachine(LabVirtualMachineArgs.builder()
 *                 .adminUser(LabVirtualMachineAdminUserArgs.builder()
 *                     .username("testadmin")
 *                     .password("Password1234!")
 *                     .build())
 *                 .imageReference(LabVirtualMachineImageReferenceArgs.builder()
 *                     .publisher("Canonical")
 *                     .offer("0001-com-ubuntu-server-jammy")
 *                     .sku("22_04-lts")
 *                     .version("latest")
 *                     .build())
 *                 .sku(LabVirtualMachineSkuArgs.builder()
 *                     .name("Classic_Fsv2_2_4GB_128_S_SSD")
 *                     .capacity(0)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleLab:
 *     type: azure:lab:Lab
 *     name: example
 *     properties:
 *       name: example-lab
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       title: Test Title
 *       security:
 *         openAccessEnabled: false
 *       virtualMachine:
 *         adminUser:
 *           username: testadmin
 *           password: Password1234!
 *         imageReference:
 *           publisher: Canonical
 *           offer: 0001-com-ubuntu-server-jammy
 *           sku: 22_04-lts
 *           version: latest
 *         sku:
 *           name: Classic_Fsv2_2_4GB_128_S_SSD
 *           capacity: 0
 * ```
 * 
 * ## Import
 * Lab Service Labs can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lab/lab:Lab example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labs/lab1
 * ```
 * @property autoShutdown An `auto_shutdown` block as defined below.
 * @property connectionSetting A `connection_setting` block as defined below.
 * @property description The description of the Lab Service Lab.
 * @property labPlanId The resource ID of the Lab Plan that is used during resource creation to provide defaults and acts as a permission container when creating a Lab Service Lab via `labs.azure.com`.
 * @property location The Azure Region where the Lab Service Lab should exist. Changing this forces a new resource to be created.
 * @property name The name which should be used for this Lab Service Lab. Changing this forces a new resource to be created.
 * @property network A `network` block as defined below.
 * @property resourceGroupName The name of the Resource Group where the Lab Service Lab should exist. Changing this forces a new resource to be created.
 * @property roster A `roster` block as defined below.
 * @property security A `security` block as defined below.
 * @property tags A mapping of tags which should be assigned to the Lab Service Lab.
 * @property title The title of the Lab Service Lab.
 * @property virtualMachine A `virtual_machine` block as defined below.
 */
public data class LabArgs(
    public val autoShutdown: Output? = null,
    public val connectionSetting: Output? = null,
    public val description: Output? = null,
    public val labPlanId: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val resourceGroupName: Output? = null,
    public val roster: Output? = null,
    public val security: Output? = null,
    public val tags: Output>? = null,
    public val title: Output? = null,
    public val virtualMachine: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lab.LabArgs = com.pulumi.azure.lab.LabArgs.builder()
        .autoShutdown(autoShutdown?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .connectionSetting(connectionSetting?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .description(description?.applyValue({ args0 -> args0 }))
        .labPlanId(labPlanId?.applyValue({ args0 -> args0 }))
        .location(location?.applyValue({ args0 -> args0 }))
        .name(name?.applyValue({ args0 -> args0 }))
        .network(network?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
        .roster(roster?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .security(security?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .title(title?.applyValue({ args0 -> args0 }))
        .virtualMachine(
            virtualMachine?.applyValue({ args0 ->
                args0.let({ args0 ->
                    args0.toJava()
                })
            }),
        ).build()
}

/**
 * Builder for [LabArgs].
 */
@PulumiTagMarker
public class LabArgsBuilder internal constructor() {
    private var autoShutdown: Output? = null

    private var connectionSetting: Output? = null

    private var description: Output? = null

    private var labPlanId: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var network: Output? = null

    private var resourceGroupName: Output? = null

    private var roster: Output? = null

    private var security: Output? = null

    private var tags: Output>? = null

    private var title: Output? = null

    private var virtualMachine: Output? = null

    /**
     * @param value An `auto_shutdown` block as defined below.
     */
    @JvmName("hspfvtihfyjnufsq")
    public suspend fun autoShutdown(`value`: Output) {
        this.autoShutdown = value
    }

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

    /**
     * @param value The description of the Lab Service Lab.
     */
    @JvmName("llndhrfecomhdpyb")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The resource ID of the Lab Plan that is used during resource creation to provide defaults and acts as a permission container when creating a Lab Service Lab via `labs.azure.com`.
     */
    @JvmName("hoervlsrairpkchj")
    public suspend fun labPlanId(`value`: Output) {
        this.labPlanId = value
    }

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

    /**
     * @param value The name which should be used for this Lab Service Lab. Changing this forces a new resource to be created.
     */
    @JvmName("cbbqsqnqgifdmjhe")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

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

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

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

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

    /**
     * @param value The title of the Lab Service Lab.
     */
    @JvmName("mmcdsnepiqvyacps")
    public suspend fun title(`value`: Output) {
        this.title = value
    }

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

    /**
     * @param value An `auto_shutdown` block as defined below.
     */
    @JvmName("jlyovcxklisfakuu")
    public suspend fun autoShutdown(`value`: LabAutoShutdownArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoShutdown = mapped
    }

    /**
     * @param argument An `auto_shutdown` block as defined below.
     */
    @JvmName("xenvkdhfuvnkupla")
    public suspend fun autoShutdown(argument: suspend LabAutoShutdownArgsBuilder.() -> Unit) {
        val toBeMapped = LabAutoShutdownArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.autoShutdown = mapped
    }

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

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

    /**
     * @param value The description of the Lab Service Lab.
     */
    @JvmName("afxktcrxriupbwii")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The resource ID of the Lab Plan that is used during resource creation to provide defaults and acts as a permission container when creating a Lab Service Lab via `labs.azure.com`.
     */
    @JvmName("mvhhhpylsjrxytyl")
    public suspend fun labPlanId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labPlanId = mapped
    }

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

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

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

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

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

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

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

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

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

    /**
     * @param value A mapping of tags which should be assigned to the Lab Service Lab.
     */
    @JvmName("wjccnbjmfxrfiuih")
    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 Lab.
     */
    @JvmName("fdfxkusleukumcld")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The title of the Lab Service Lab.
     */
    @JvmName("wlqaofgcmnnoqgep")
    public suspend fun title(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.title = mapped
    }

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

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

    internal fun build(): LabArgs = LabArgs(
        autoShutdown = autoShutdown,
        connectionSetting = connectionSetting,
        description = description,
        labPlanId = labPlanId,
        location = location,
        name = name,
        network = network,
        resourceGroupName = resourceGroupName,
        roster = roster,
        security = security,
        tags = tags,
        title = title,
        virtualMachine = virtualMachine,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy