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

com.pulumi.azurenative.devopsinfrastructure.kotlin.PoolArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.devopsinfrastructure.kotlin

import com.pulumi.azurenative.devopsinfrastructure.PoolArgs.builder
import com.pulumi.azurenative.devopsinfrastructure.kotlin.enums.ProvisioningState
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.AzureDevOpsOrganizationProfileArgs
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.AzureDevOpsOrganizationProfileArgsBuilder
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.ManagedServiceIdentityArgs
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.ManagedServiceIdentityArgsBuilder
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.StatefulArgs
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.StatelessAgentProfileArgs
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.VmssFabricProfileArgs
import com.pulumi.azurenative.devopsinfrastructure.kotlin.inputs.VmssFabricProfileArgsBuilder
import com.pulumi.core.Either
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Concrete tracked resource types can be created by aliasing this type using a specific property type.
 * Azure REST API version: 2023-10-30-preview.
 * Other available API versions: 2023-12-13-preview, 2024-03-26-preview, 2024-04-04-preview.
 * ## Example Usage
 * ### Pools_CreateOrUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var pool = new AzureNative.DevOpsInfrastructure.Pool("pool", new()
 *     {
 *         AgentProfile = new AzureNative.DevOpsInfrastructure.Inputs.StatelessAgentProfileArgs
 *         {
 *             Kind = "Stateless",
 *         },
 *         DevCenterProjectResourceId = "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES",
 *         FabricProfile = new AzureNative.DevOpsInfrastructure.Inputs.VmssFabricProfileArgs
 *         {
 *             Images = new[]
 *             {
 *                 new AzureNative.DevOpsInfrastructure.Inputs.PoolImageArgs
 *                 {
 *                     ResourceId = "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest",
 *                 },
 *             },
 *             Kind = "Vmss",
 *             Sku = new AzureNative.DevOpsInfrastructure.Inputs.DevOpsAzureSkuArgs
 *             {
 *                 Name = "Standard_D4ads_v5",
 *             },
 *         },
 *         Location = "eastus",
 *         MaximumConcurrency = 10,
 *         OrganizationProfile = new AzureNative.DevOpsInfrastructure.Inputs.AzureDevOpsOrganizationProfileArgs
 *         {
 *             Kind = "AzureDevOps",
 *             Organizations = new[]
 *             {
 *                 new AzureNative.DevOpsInfrastructure.Inputs.OrganizationArgs
 *                 {
 *                     Url = "https://mseng.visualstudio.com",
 *                 },
 *             },
 *         },
 *         PoolName = "pool",
 *         ProvisioningState = AzureNative.DevOpsInfrastructure.ProvisioningState.Succeeded,
 *         ResourceGroupName = "rg",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	devopsinfrastructure "github.com/pulumi/pulumi-azure-native-sdk/devopsinfrastructure/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := devopsinfrastructure.NewPool(ctx, "pool", &devopsinfrastructure.PoolArgs{
 * 			AgentProfile: &devopsinfrastructure.StatelessAgentProfileArgs{
 * 				Kind: pulumi.String("Stateless"),
 * 			},
 * 			DevCenterProjectResourceId: pulumi.String("/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES"),
 * 			FabricProfile: &devopsinfrastructure.VmssFabricProfileArgs{
 * 				Images: devopsinfrastructure.PoolImageArray{
 * 					&devopsinfrastructure.PoolImageArgs{
 * 						ResourceId: pulumi.String("/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest"),
 * 					},
 * 				},
 * 				Kind: pulumi.String("Vmss"),
 * 				Sku: &devopsinfrastructure.DevOpsAzureSkuArgs{
 * 					Name: pulumi.String("Standard_D4ads_v5"),
 * 				},
 * 			},
 * 			Location:           pulumi.String("eastus"),
 * 			MaximumConcurrency: pulumi.Int(10),
 * 			OrganizationProfile: &devopsinfrastructure.AzureDevOpsOrganizationProfileArgs{
 * 				Kind: pulumi.String("AzureDevOps"),
 * 				Organizations: devopsinfrastructure.OrganizationArray{
 * 					&devopsinfrastructure.OrganizationArgs{
 * 						Url: pulumi.String("https://mseng.visualstudio.com"),
 * 					},
 * 				},
 * 			},
 * 			PoolName:          pulumi.String("pool"),
 * 			ProvisioningState: pulumi.String(devopsinfrastructure.ProvisioningStateSucceeded),
 * 			ResourceGroupName: pulumi.String("rg"),
 * 		})
 * 		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.azurenative.devopsinfrastructure.Pool;
 * import com.pulumi.azurenative.devopsinfrastructure.PoolArgs;
 * import com.pulumi.azurenative.devopsinfrastructure.inputs.VmssFabricProfileArgs;
 * import com.pulumi.azurenative.devopsinfrastructure.inputs.DevOpsAzureSkuArgs;
 * import com.pulumi.azurenative.devopsinfrastructure.inputs.AzureDevOpsOrganizationProfileArgs;
 * 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 pool = new Pool("pool", PoolArgs.builder()
 *             .agentProfile(StatelessAgentProfileArgs.builder()
 *                 .kind("Stateless")
 *                 .build())
 *             .devCenterProjectResourceId("/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES")
 *             .fabricProfile(VmssFabricProfileArgs.builder()
 *                 .images(PoolImageArgs.builder()
 *                     .resourceId("/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest")
 *                     .build())
 *                 .kind("Vmss")
 *                 .sku(DevOpsAzureSkuArgs.builder()
 *                     .name("Standard_D4ads_v5")
 *                     .build())
 *                 .build())
 *             .location("eastus")
 *             .maximumConcurrency(10)
 *             .organizationProfile(AzureDevOpsOrganizationProfileArgs.builder()
 *                 .kind("AzureDevOps")
 *                 .organizations(OrganizationArgs.builder()
 *                     .url("https://mseng.visualstudio.com")
 *                     .build())
 *                 .build())
 *             .poolName("pool")
 *             .provisioningState("Succeeded")
 *             .resourceGroupName("rg")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:devopsinfrastructure:Pool myresource1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}
 * ```
 * @property agentProfile Defines how the machine will be handled once it executed a job.
 * @property devCenterProjectResourceId The resource id of the DevCenter Project the pool belongs to.
 * @property fabricProfile Defines the type of fabric the agent will run on.
 * @property identity The managed service identities assigned to this resource.
 * @property location The geo-location where the resource lives
 * @property maximumConcurrency Defines how many resources can there be created at any given time.
 * @property organizationProfile Defines the organization in which the pool will be used.
 * @property poolName Name of the pool. It needs to be globally unique.
 * @property provisioningState The status of the current operation.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property tags Resource tags.
 */
public data class PoolArgs(
    public val agentProfile: Output>? = null,
    public val devCenterProjectResourceId: Output? = null,
    public val fabricProfile: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val maximumConcurrency: Output? = null,
    public val organizationProfile: Output? = null,
    public val poolName: Output? = null,
    public val provisioningState: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.devopsinfrastructure.PoolArgs =
        com.pulumi.azurenative.devopsinfrastructure.PoolArgs.builder()
            .agentProfile(
                agentProfile?.applyValue({ args0 ->
                    args0.transform({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    }, { args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .devCenterProjectResourceId(devCenterProjectResourceId?.applyValue({ args0 -> args0 }))
            .fabricProfile(fabricProfile?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .maximumConcurrency(maximumConcurrency?.applyValue({ args0 -> args0 }))
            .organizationProfile(
                organizationProfile?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .poolName(poolName?.applyValue({ args0 -> args0 }))
            .provisioningState(
                provisioningState?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

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

    private var devCenterProjectResourceId: Output? = null

    private var fabricProfile: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var maximumConcurrency: Output? = null

    private var organizationProfile: Output? = null

    private var poolName: Output? = null

    private var provisioningState: Output>? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Defines how the machine will be handled once it executed a job.
     */
    @JvmName("ishhltgwqiugbkba")
    public suspend fun agentProfile(`value`: Output>) {
        this.agentProfile = value
    }

    /**
     * @param value The resource id of the DevCenter Project the pool belongs to.
     */
    @JvmName("ytcelkjpqqgumarm")
    public suspend fun devCenterProjectResourceId(`value`: Output) {
        this.devCenterProjectResourceId = value
    }

    /**
     * @param value Defines the type of fabric the agent will run on.
     */
    @JvmName("vwgdfoajtgmkvuyv")
    public suspend fun fabricProfile(`value`: Output) {
        this.fabricProfile = value
    }

    /**
     * @param value The managed service identities assigned to this resource.
     */
    @JvmName("solxxmxhpocfkyaf")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("ykvdokbbunfjfyll")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Defines how many resources can there be created at any given time.
     */
    @JvmName("wassjjyxeqkmsvon")
    public suspend fun maximumConcurrency(`value`: Output) {
        this.maximumConcurrency = value
    }

    /**
     * @param value Defines the organization in which the pool will be used.
     */
    @JvmName("ksjqbatrynhqeigg")
    public suspend fun organizationProfile(`value`: Output) {
        this.organizationProfile = value
    }

    /**
     * @param value Name of the pool. It needs to be globally unique.
     */
    @JvmName("jpqkilvngcawexkd")
    public suspend fun poolName(`value`: Output) {
        this.poolName = value
    }

    /**
     * @param value The status of the current operation.
     */
    @JvmName("kuakoqycinycuxip")
    public suspend fun provisioningState(`value`: Output>) {
        this.provisioningState = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("uoviiyeusqwssxop")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("tgxvmtebraglkxmn")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Defines how the machine will be handled once it executed a job.
     */
    @JvmName("abcagplbypkjfsfh")
    public suspend fun agentProfile(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.agentProfile = mapped
    }

    /**
     * @param value Defines how the machine will be handled once it executed a job.
     */
    @JvmName("ojcridtlopbgekfy")
    public fun agentProfile(`value`: StatefulArgs) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.agentProfile = mapped
    }

    /**
     * @param value Defines how the machine will be handled once it executed a job.
     */
    @JvmName("vjaykbhqyifvgwgp")
    public fun agentProfile(`value`: StatelessAgentProfileArgs) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.agentProfile = mapped
    }

    /**
     * @param value The resource id of the DevCenter Project the pool belongs to.
     */
    @JvmName("vppeohqlebofdswn")
    public suspend fun devCenterProjectResourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.devCenterProjectResourceId = mapped
    }

    /**
     * @param value Defines the type of fabric the agent will run on.
     */
    @JvmName("erbclqenqxltchpd")
    public suspend fun fabricProfile(`value`: VmssFabricProfileArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fabricProfile = mapped
    }

    /**
     * @param argument Defines the type of fabric the agent will run on.
     */
    @JvmName("jyvnsplyyngsxdqd")
    public suspend fun fabricProfile(argument: suspend VmssFabricProfileArgsBuilder.() -> Unit) {
        val toBeMapped = VmssFabricProfileArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.fabricProfile = mapped
    }

    /**
     * @param value The managed service identities assigned to this resource.
     */
    @JvmName("ymlqqapfudyyjcar")
    public suspend fun identity(`value`: ManagedServiceIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument The managed service identities assigned to this resource.
     */
    @JvmName("ohceplstcfqulfge")
    public suspend fun identity(argument: suspend ManagedServiceIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = ManagedServiceIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("hdqlpflpsapkilwt")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Defines how many resources can there be created at any given time.
     */
    @JvmName("inuwsnlgfoyhhucc")
    public suspend fun maximumConcurrency(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumConcurrency = mapped
    }

    /**
     * @param value Defines the organization in which the pool will be used.
     */
    @JvmName("sffxtccilbttlqsk")
    public suspend fun organizationProfile(`value`: AzureDevOpsOrganizationProfileArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.organizationProfile = mapped
    }

    /**
     * @param argument Defines the organization in which the pool will be used.
     */
    @JvmName("bwgacyuibrcsyqog")
    public suspend fun organizationProfile(argument: suspend AzureDevOpsOrganizationProfileArgsBuilder.() -> Unit) {
        val toBeMapped = AzureDevOpsOrganizationProfileArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.organizationProfile = mapped
    }

    /**
     * @param value Name of the pool. It needs to be globally unique.
     */
    @JvmName("eyehhmtyagndosqo")
    public suspend fun poolName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.poolName = mapped
    }

    /**
     * @param value The status of the current operation.
     */
    @JvmName("hypftcbkpcmffuxn")
    public suspend fun provisioningState(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.provisioningState = mapped
    }

    /**
     * @param value The status of the current operation.
     */
    @JvmName("qnfcmdlhkyfekdbm")
    public fun provisioningState(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.provisioningState = mapped
    }

    /**
     * @param value The status of the current operation.
     */
    @JvmName("jmgktkexkbgaqyua")
    public fun provisioningState(`value`: ProvisioningState) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.provisioningState = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("sgrajpshdctpknsd")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("cvpwivywgvyyhnxm")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags.
     */
    @JvmName("brbbmiuoqtfdlisi")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): PoolArgs = PoolArgs(
        agentProfile = agentProfile,
        devCenterProjectResourceId = devCenterProjectResourceId,
        fabricProfile = fabricProfile,
        identity = identity,
        location = location,
        maximumConcurrency = maximumConcurrency,
        organizationProfile = organizationProfile,
        poolName = poolName,
        provisioningState = provisioningState,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy