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

com.pulumi.azure.devcenter.kotlin.DevBoxDefinition.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.devcenter.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

/**
 * Builder for [DevBoxDefinition].
 */
@PulumiTagMarker
public class DevBoxDefinitionResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DevBoxDefinitionArgs = DevBoxDefinitionArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend DevBoxDefinitionArgsBuilder.() -> Unit) {
        val builder = DevBoxDefinitionArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): DevBoxDefinition {
        val builtJavaResource = com.pulumi.azure.devcenter.DevBoxDefinition(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DevBoxDefinition(builtJavaResource)
    }
}

/**
 * Manages a Dev Center Dev Box Definition.
 * ## 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 exampleDevCenter = new azure.devcenter.DevCenter("example", {
 *     name: "example-dc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleDevBoxDefinition = new azure.devcenter.DevBoxDefinition("example", {
 *     name: "example-dcet",
 *     location: example.location,
 *     devCenterId: exampleDevCenter.id,
 *     imageReferenceId: pulumi.interpolate`${exampleDevCenter.id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2`,
 *     skuName: "general_i_8c32gb256ssd_v2",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_dev_center = azure.devcenter.DevCenter("example",
 *     name="example-dc",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_dev_box_definition = azure.devcenter.DevBoxDefinition("example",
 *     name="example-dcet",
 *     location=example.location,
 *     dev_center_id=example_dev_center.id,
 *     image_reference_id=example_dev_center.id.apply(lambda id: f"{id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2"),
 *     sku_name="general_i_8c32gb256ssd_v2")
 * ```
 * ```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 exampleDevCenter = new Azure.DevCenter.DevCenter("example", new()
 *     {
 *         Name = "example-dc",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Identity = new Azure.DevCenter.Inputs.DevCenterIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleDevBoxDefinition = new Azure.DevCenter.DevBoxDefinition("example", new()
 *     {
 *         Name = "example-dcet",
 *         Location = example.Location,
 *         DevCenterId = exampleDevCenter.Id,
 *         ImageReferenceId = exampleDevCenter.Id.Apply(id => $"{id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2"),
 *         SkuName = "general_i_8c32gb256ssd_v2",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devcenter"
 * 	"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
 * 		}
 * 		exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
 * 			Name:              pulumi.String("example-dc"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Identity: &devcenter.DevCenterIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = devcenter.NewDevBoxDefinition(ctx, "example", &devcenter.DevBoxDefinitionArgs{
 * 			Name:        pulumi.String("example-dcet"),
 * 			Location:    example.Location,
 * 			DevCenterId: exampleDevCenter.ID(),
 * 			ImageReferenceId: exampleDevCenter.ID().ApplyT(func(id string) (string, error) {
 * 				return fmt.Sprintf("%v/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2", id), nil
 * 			}).(pulumi.StringOutput),
 * 			SkuName: pulumi.String("general_i_8c32gb256ssd_v2"),
 * 		})
 * 		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.devcenter.DevCenter;
 * import com.pulumi.azure.devcenter.DevCenterArgs;
 * import com.pulumi.azure.devcenter.inputs.DevCenterIdentityArgs;
 * import com.pulumi.azure.devcenter.DevBoxDefinition;
 * import com.pulumi.azure.devcenter.DevBoxDefinitionArgs;
 * 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 exampleDevCenter = new DevCenter("exampleDevCenter", DevCenterArgs.builder()
 *             .name("example-dc")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .identity(DevCenterIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleDevBoxDefinition = new DevBoxDefinition("exampleDevBoxDefinition", DevBoxDefinitionArgs.builder()
 *             .name("example-dcet")
 *             .location(example.location())
 *             .devCenterId(exampleDevCenter.id())
 *             .imageReferenceId(exampleDevCenter.id().applyValue(id -> String.format("%s/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2", id)))
 *             .skuName("general_i_8c32gb256ssd_v2")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleDevCenter:
 *     type: azure:devcenter:DevCenter
 *     name: example
 *     properties:
 *       name: example-dc
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       identity:
 *         type: SystemAssigned
 *   exampleDevBoxDefinition:
 *     type: azure:devcenter:DevBoxDefinition
 *     name: example
 *     properties:
 *       name: example-dcet
 *       location: ${example.location}
 *       devCenterId: ${exampleDevCenter.id}
 *       imageReferenceId: ${exampleDevCenter.id}/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2
 *       skuName: general_i_8c32gb256ssd_v2
 * ```
 * 
 * ## Import
 * An existing Dev Center Dev Box Definition can be imported into Terraform using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:devcenter/devBoxDefinition:DevBoxDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/devCenters/dc1/devBoxDefinitions/et1
 * ```
 */
public class DevBoxDefinition internal constructor(
    override val javaResource: com.pulumi.azure.devcenter.DevBoxDefinition,
) : KotlinCustomResource(javaResource, DevBoxDefinitionMapper) {
    /**
     * The ID of the associated Dev Center. Changing this forces a new resource to be created.
     */
    public val devCenterId: Output
        get() = javaResource.devCenterId().applyValue({ args0 -> args0 })

    /**
     * The ID of the image for the Dev Center Dev Box Definition.
     */
    public val imageReferenceId: Output
        get() = javaResource.imageReferenceId().applyValue({ args0 -> args0 })

    /**
     * The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the SKU for the Dev Center Dev Box Definition.
     */
    public val skuName: Output
        get() = javaResource.skuName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object DevBoxDefinitionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.devcenter.DevBoxDefinition::class == javaResource::class

    override fun map(javaResource: Resource): DevBoxDefinition = DevBoxDefinition(
        javaResource as
            com.pulumi.azure.devcenter.DevBoxDefinition,
    )
}

/**
 * @see [DevBoxDefinition].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [DevBoxDefinition].
 */
public suspend fun devBoxDefinition(
    name: String,
    block: suspend DevBoxDefinitionResourceBuilder.() -> Unit,
): DevBoxDefinition {
    val builder = DevBoxDefinitionResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [DevBoxDefinition].
 * @param name The _unique_ name of the resulting resource.
 */
public fun devBoxDefinition(name: String): DevBoxDefinition {
    val builder = DevBoxDefinitionResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy