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

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

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

package com.pulumi.azure.devcenter.kotlin

import com.pulumi.azure.devcenter.kotlin.outputs.DevCenterIdentity
import com.pulumi.azure.devcenter.kotlin.outputs.DevCenterIdentity.Companion.toKotlin
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 [DevCenter].
 */
@PulumiTagMarker
public class DevCenterResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DevCenterArgs = DevCenterArgs()

    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 DevCenterArgsBuilder.() -> Unit) {
        val builder = DevCenterArgsBuilder()
        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(): DevCenter {
        val builtJavaResource = com.pulumi.azure.devcenter.DevCenter(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DevCenter(builtJavaResource)
    }
}

/**
 * 
 * Manages a Dev Center.
 * ## 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 exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleDevCenter = new azure.devcenter.DevCenter("example", {
 *     location: example.location,
 *     name: "example",
 *     resourceGroupName: example.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_dev_center = azure.devcenter.DevCenter("example",
 *     location=example.location,
 *     name="example",
 *     resource_group_name=example.name)
 * ```
 * ```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 exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleDevCenter = new Azure.DevCenter.DevCenter("example", new()
 *     {
 *         Location = example.Location,
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"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
 * 		}
 * 		_, err = authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
 * 			Location:          example.Location,
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		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.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.devcenter.DevCenter;
 * import com.pulumi.azure.devcenter.DevCenterArgs;
 * 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 exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleDevCenter = new DevCenter("exampleDevCenter", DevCenterArgs.builder()
 *             .location(example.location())
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleUserAssignedIdentity:
 *     type: azure:authorization:UserAssignedIdentity
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleDevCenter:
 *     type: azure:devcenter:DevCenter
 *     name: example
 *     properties:
 *       location: ${example.location}
 *       name: example
 *       resourceGroupName: ${example.name}
 * ```
 * 
 * ## Blocks Reference
 * ### `identity` Block
 * The `identity` block supports the following arguments:
 * * `type` - (Required) Specifies the type of Managed Identity that should be assigned to this Dev Center. Possible values are `SystemAssigned`, `SystemAssigned, UserAssigned` and `UserAssigned`.
 * * `identity_ids` - (Optional) A list of the User Assigned Identity IDs that should be assigned to this Dev Center.
 * In addition to the arguments defined above, the `identity` block exports the following attributes:
 * * `principal_id` - The Principal ID for the System-Assigned Managed Identity assigned to this Dev Center.
 * * `tenant_id` - The Tenant ID for the System-Assigned Managed Identity assigned to this Dev Center.
 * ## Import
 * An existing Dev Center can be imported into Terraform using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:devcenter/devCenter:DevCenter example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devCenters/{devCenterName}
 * ```
 * * Where `{subscriptionId}` is the ID of the Azure Subscription where the Dev Center exists. For example `12345678-1234-9876-4563-123456789012`.
 * * Where `{resourceGroupName}` is the name of Resource Group where this Dev Center exists. For example `example-resource-group`.
 * * Where `{devCenterName}` is the name of the Dev Center. For example `devCenterValue`.
 */
public class DevCenter internal constructor(
    override val javaResource: com.pulumi.azure.devcenter.DevCenter,
) : KotlinCustomResource(javaResource, DevCenterMapper) {
    /**
     * The URI of the Dev Center.
     */
    public val devCenterUri: Output
        get() = javaResource.devCenterUri().applyValue({ args0 -> args0 })

    /**
     * An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

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

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

    /**
     * Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Dev Center.
     */
    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 DevCenterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.devcenter.DevCenter::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy