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

com.pulumi.azure.desktopvirtualization.kotlin.GetHostPoolRegistrationInfo.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.desktopvirtualization.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

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

    public var args: GetHostPoolRegistrationInfoArgs = GetHostPoolRegistrationInfoArgs()

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

/**
 * Manages the Registration Info for a Virtual Desktop Host Pool.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-hostpool",
 *     location: "westeurope",
 * });
 * const exampleHostPool = new azure.desktopvirtualization.HostPool("example", {
 *     name: "example-HP",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     type: "Pooled",
 *     validateEnvironment: true,
 *     loadBalancerType: "BreadthFirst",
 * });
 * const exampleGetHostPoolRegistrationInfo = new azure.desktopvirtualization.GetHostPoolRegistrationInfo("example", {
 *     hostpoolId: exampleHostPool.id,
 *     expirationDate: "2022-01-01T23:40:52Z",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-hostpool",
 *     location="westeurope")
 * example_host_pool = azure.desktopvirtualization.HostPool("example",
 *     name="example-HP",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     type="Pooled",
 *     validate_environment=True,
 *     load_balancer_type="BreadthFirst")
 * example_get_host_pool_registration_info = azure.desktopvirtualization.GetHostPoolRegistrationInfo("example",
 *     hostpool_id=example_host_pool.id,
 *     expiration_date="2022-01-01T23:40:52Z")
 * ```
 * ```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-hostpool",
 *         Location = "westeurope",
 *     });
 *     var exampleHostPool = new Azure.DesktopVirtualization.HostPool("example", new()
 *     {
 *         Name = "example-HP",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Type = "Pooled",
 *         ValidateEnvironment = true,
 *         LoadBalancerType = "BreadthFirst",
 *     });
 *     var exampleGetHostPoolRegistrationInfo = new Azure.DesktopVirtualization.GetHostPoolRegistrationInfo("example", new()
 *     {
 *         HostpoolId = exampleHostPool.Id,
 *         ExpirationDate = "2022-01-01T23:40:52Z",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization"
 * 	"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-hostpool"),
 * 			Location: pulumi.String("westeurope"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleHostPool, err := desktopvirtualization.NewHostPool(ctx, "example", &desktopvirtualization.HostPoolArgs{
 * 			Name:                pulumi.String("example-HP"),
 * 			Location:            example.Location,
 * 			ResourceGroupName:   example.Name,
 * 			Type:                pulumi.String("Pooled"),
 * 			ValidateEnvironment: pulumi.Bool(true),
 * 			LoadBalancerType:    pulumi.String("BreadthFirst"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = desktopvirtualization.NewgetHostPoolRegistrationInfo(ctx, "example", &desktopvirtualization.getHostPoolRegistrationInfoArgs{
 * 			HostpoolId:     exampleHostPool.ID(),
 * 			ExpirationDate: pulumi.String("2022-01-01T23:40:52Z"),
 * 		})
 * 		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.desktopvirtualization.HostPool;
 * import com.pulumi.azure.desktopvirtualization.HostPoolArgs;
 * import com.pulumi.azure.desktopvirtualization.getHostPoolRegistrationInfo;
 * import com.pulumi.azure.desktopvirtualization.GetHostPoolRegistrationInfoArgs;
 * 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-hostpool")
 *             .location("westeurope")
 *             .build());
 *         var exampleHostPool = new HostPool("exampleHostPool", HostPoolArgs.builder()
 *             .name("example-HP")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .type("Pooled")
 *             .validateEnvironment(true)
 *             .loadBalancerType("BreadthFirst")
 *             .build());
 *         var exampleGetHostPoolRegistrationInfo = new GetHostPoolRegistrationInfo("exampleGetHostPoolRegistrationInfo", GetHostPoolRegistrationInfoArgs.builder()
 *             .hostpoolId(exampleHostPool.id())
 *             .expirationDate("2022-01-01T23:40:52Z")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-hostpool
 *       location: westeurope
 *   exampleHostPool:
 *     type: azure:desktopvirtualization:HostPool
 *     name: example
 *     properties:
 *       name: example-HP
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       type: Pooled
 *       validateEnvironment: true
 *       loadBalancerType: BreadthFirst
 *   exampleGetHostPoolRegistrationInfo:
 *     type: azure:desktopvirtualization:getHostPoolRegistrationInfo
 *     name: example
 *     properties:
 *       hostpoolId: ${exampleHostPool.id}
 *       expirationDate: 2022-01-01T23:40:52Z
 * ```
 * 
 * ## Import
 * AVD Registration Infos can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:desktopvirtualization/getHostPoolRegistrationInfo:getHostPoolRegistrationInfo example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DesktopVirtualization/hostPools/pool1/registrationInfo/default
 * ```
 */
public class GetHostPoolRegistrationInfo internal constructor(
    override val javaResource: com.pulumi.azure.desktopvirtualization.GetHostPoolRegistrationInfo,
) : KotlinCustomResource(javaResource, GetHostPoolRegistrationInfoMapper) {
    /**
     * A valid `RFC3339Time` for the expiration of the token..
     */
    public val expirationDate: Output
        get() = javaResource.expirationDate().applyValue({ args0 -> args0 })

    /**
     * The ID of the Virtual Desktop Host Pool to link the Registration Info to. Changing this forces a new Registration Info resource to be created. Only a single virtual_desktop_host_pool_registration_info resource should be associated with a given hostpool. Assigning multiple resources will produce inconsistent results.
     */
    public val hostpoolId: Output
        get() = javaResource.hostpoolId().applyValue({ args0 -> args0 })

    /**
     * The registration token generated by the Virtual Desktop Host Pool for registration of session hosts.
     */
    public val token: Output
        get() = javaResource.token().applyValue({ args0 -> args0 })
}

public object GetHostPoolRegistrationInfoMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.desktopvirtualization.GetHostPoolRegistrationInfo::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy