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

com.pulumi.azure.containerservice.kotlin.KubernetesClusterNodePool.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.containerservice.kotlin

import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolKubeletConfig
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolLinuxOsConfig
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolNodeNetworkProfile
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolUpgradeSettings
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolWindowsProfile
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.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolKubeletConfig.Companion.toKotlin as kubernetesClusterNodePoolKubeletConfigToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolLinuxOsConfig.Companion.toKotlin as kubernetesClusterNodePoolLinuxOsConfigToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolNodeNetworkProfile.Companion.toKotlin as kubernetesClusterNodePoolNodeNetworkProfileToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolUpgradeSettings.Companion.toKotlin as kubernetesClusterNodePoolUpgradeSettingsToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.KubernetesClusterNodePoolWindowsProfile.Companion.toKotlin as kubernetesClusterNodePoolWindowsProfileToKotlin

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

    public var args: KubernetesClusterNodePoolArgs = KubernetesClusterNodePoolArgs()

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

/**
 * Manages a Node Pool within a Kubernetes Cluster
 * > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets.
 * ## Example Usage
 * This example provisions a basic Kubernetes Node Pool.
 * 
 * ```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 exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
 *     name: "example-aks1",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     dnsPrefix: "exampleaks1",
 *     defaultNodePool: {
 *         name: "default",
 *         nodeCount: 1,
 *         vmSize: "Standard_D2_v2",
 *     },
 *     servicePrincipal: {
 *         clientId: "00000000-0000-0000-0000-000000000000",
 *         clientSecret: "00000000000000000000000000000000",
 *     },
 * });
 * const exampleKubernetesClusterNodePool = new azure.containerservice.KubernetesClusterNodePool("example", {
 *     name: "internal",
 *     kubernetesClusterId: exampleKubernetesCluster.id,
 *     vmSize: "Standard_DS2_v2",
 *     nodeCount: 1,
 *     tags: {
 *         Environment: "Production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_kubernetes_cluster = azure.containerservice.KubernetesCluster("example",
 *     name="example-aks1",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     dns_prefix="exampleaks1",
 *     default_node_pool={
 *         "name": "default",
 *         "node_count": 1,
 *         "vm_size": "Standard_D2_v2",
 *     },
 *     service_principal={
 *         "client_id": "00000000-0000-0000-0000-000000000000",
 *         "client_secret": "00000000000000000000000000000000",
 *     })
 * example_kubernetes_cluster_node_pool = azure.containerservice.KubernetesClusterNodePool("example",
 *     name="internal",
 *     kubernetes_cluster_id=example_kubernetes_cluster.id,
 *     vm_size="Standard_DS2_v2",
 *     node_count=1,
 *     tags={
 *         "Environment": "Production",
 *     })
 * ```
 * ```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 exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("example", new()
 *     {
 *         Name = "example-aks1",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         DnsPrefix = "exampleaks1",
 *         DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
 *         {
 *             Name = "default",
 *             NodeCount = 1,
 *             VmSize = "Standard_D2_v2",
 *         },
 *         ServicePrincipal = new Azure.ContainerService.Inputs.KubernetesClusterServicePrincipalArgs
 *         {
 *             ClientId = "00000000-0000-0000-0000-000000000000",
 *             ClientSecret = "00000000000000000000000000000000",
 *         },
 *     });
 *     var exampleKubernetesClusterNodePool = new Azure.ContainerService.KubernetesClusterNodePool("example", new()
 *     {
 *         Name = "internal",
 *         KubernetesClusterId = exampleKubernetesCluster.Id,
 *         VmSize = "Standard_DS2_v2",
 *         NodeCount = 1,
 *         Tags =
 *         {
 *             { "Environment", "Production" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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
 * 		}
 * 		exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
 * 			Name:              pulumi.String("example-aks1"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			DnsPrefix:         pulumi.String("exampleaks1"),
 * 			DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
 * 				Name:      pulumi.String("default"),
 * 				NodeCount: pulumi.Int(1),
 * 				VmSize:    pulumi.String("Standard_D2_v2"),
 * 			},
 * 			ServicePrincipal: &containerservice.KubernetesClusterServicePrincipalArgs{
 * 				ClientId:     pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 				ClientSecret: pulumi.String("00000000000000000000000000000000"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = containerservice.NewKubernetesClusterNodePool(ctx, "example", &containerservice.KubernetesClusterNodePoolArgs{
 * 			Name:                pulumi.String("internal"),
 * 			KubernetesClusterId: exampleKubernetesCluster.ID(),
 * 			VmSize:              pulumi.String("Standard_DS2_v2"),
 * 			NodeCount:           pulumi.Int(1),
 * 			Tags: pulumi.StringMap{
 * 				"Environment": pulumi.String("Production"),
 * 			},
 * 		})
 * 		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.containerservice.KubernetesCluster;
 * import com.pulumi.azure.containerservice.KubernetesClusterArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterServicePrincipalArgs;
 * import com.pulumi.azure.containerservice.KubernetesClusterNodePool;
 * import com.pulumi.azure.containerservice.KubernetesClusterNodePoolArgs;
 * 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 exampleKubernetesCluster = new KubernetesCluster("exampleKubernetesCluster", KubernetesClusterArgs.builder()
 *             .name("example-aks1")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .dnsPrefix("exampleaks1")
 *             .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
 *                 .name("default")
 *                 .nodeCount(1)
 *                 .vmSize("Standard_D2_v2")
 *                 .build())
 *             .servicePrincipal(KubernetesClusterServicePrincipalArgs.builder()
 *                 .clientId("00000000-0000-0000-0000-000000000000")
 *                 .clientSecret("00000000000000000000000000000000")
 *                 .build())
 *             .build());
 *         var exampleKubernetesClusterNodePool = new KubernetesClusterNodePool("exampleKubernetesClusterNodePool", KubernetesClusterNodePoolArgs.builder()
 *             .name("internal")
 *             .kubernetesClusterId(exampleKubernetesCluster.id())
 *             .vmSize("Standard_DS2_v2")
 *             .nodeCount(1)
 *             .tags(Map.of("Environment", "Production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleKubernetesCluster:
 *     type: azure:containerservice:KubernetesCluster
 *     name: example
 *     properties:
 *       name: example-aks1
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       dnsPrefix: exampleaks1
 *       defaultNodePool:
 *         name: default
 *         nodeCount: 1
 *         vmSize: Standard_D2_v2
 *       servicePrincipal:
 *         clientId: 00000000-0000-0000-0000-000000000000
 *         clientSecret: '00000000000000000000000000000000'
 *   exampleKubernetesClusterNodePool:
 *     type: azure:containerservice:KubernetesClusterNodePool
 *     name: example
 *     properties:
 *       name: internal
 *       kubernetesClusterId: ${exampleKubernetesCluster.id}
 *       vmSize: Standard_DS2_v2
 *       nodeCount: 1
 *       tags:
 *         Environment: Production
 * ```
 * 
 * ## Import
 * Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:containerservice/kubernetesClusterNodePool:KubernetesClusterNodePool pool1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool1
 * ```
 */
public class KubernetesClusterNodePool internal constructor(
    override val javaResource: com.pulumi.azure.containerservice.KubernetesClusterNodePool,
) : KotlinCustomResource(javaResource, KubernetesClusterNodePoolMapper) {
    /**
     * Specifies the ID of the Capacity Reservation Group where this Node Pool should exist. Changing this forces a new resource to be created.
     */
    public val capacityReservationGroupId: Output?
        get() = javaResource.capacityReservationGroupId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies whether to trust a Custom CA.
     * > **Note:** This requires that the Preview Feature `Microsoft.ContainerService/CustomCATrustPreview` is enabled and the Resource Provider is re-registered, see [the documentation](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) for more information.
     */
    public val customCaTrustEnabled: Output?
        get() = javaResource.customCaTrustEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether to enable [auto-scaler](https://docs.microsoft.com/azure/aks/cluster-autoscaler).
     */
    public val enableAutoScaling: Output?
        get() = javaResource.enableAutoScaling().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Should the nodes in this Node Pool have host encryption enabled? Changing this forces a new resource to be created.
     * > **NOTE:** Additional fields must be configured depending on the value of this field - see below.
     */
    public val enableHostEncryption: Output?
        get() = javaResource.enableHostEncryption().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Should each node have a Public IP Address? Changing this forces a new resource to be created.
     */
    public val enableNodePublicIp: Output?
        get() = javaResource.enableNodePublicIp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Eviction Policy which should be used for Virtual Machines within the Virtual Machine Scale Set powering this Node Pool. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
     * > **Note:** An Eviction Policy can only be configured when `priority` is set to `Spot` and will default to `Delete` unless otherwise specified.
     */
    public val evictionPolicy: Output?
        get() = javaResource.evictionPolicy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Should the nodes in this Node Pool have Federal Information Processing Standard enabled? Changing this forces a new resource to be created.
     * > **Note:** FIPS support is in Public Preview - more information and details on how to opt into the Preview can be found in [this article](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview).
     */
    public val fipsEnabled: Output?
        get() = javaResource.fipsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the GPU MIG instance profile for supported GPU VM SKU. The allowed values are `MIG1g`, `MIG2g`, `MIG3g`, `MIG4g` and `MIG7g`. Changing this forces a new resource to be created.
     */
    public val gpuInstance: Output?
        get() = javaResource.gpuInstance().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The fully qualified resource ID of the Dedicated Host Group to provision virtual machines from. Changing this forces a new resource to be created.
     */
    public val hostGroupId: Output?
        get() = javaResource.hostGroupId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `kubelet_config` block as defined below. Changing this forces a new resource to be created.
     */
    public val kubeletConfig: Output?
        get() = javaResource.kubeletConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> kubernetesClusterNodePoolKubeletConfigToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The type of disk used by kubelet. Possible values are `OS` and `Temporary`.
     */
    public val kubeletDiskType: Output
        get() = javaResource.kubeletDiskType().applyValue({ args0 -> args0 })

    /**
     * The ID of the Kubernetes Cluster where this Node Pool should exist. Changing this forces a new resource to be created.
     * > **NOTE:** The type of Default Node Pool for the Kubernetes Cluster must be `VirtualMachineScaleSets` to attach multiple node pools.
     */
    public val kubernetesClusterId: Output
        get() = javaResource.kubernetesClusterId().applyValue({ args0 -> args0 })

    /**
     * A `linux_os_config` block as defined below. Changing this forces a new resource to be created.
     */
    public val linuxOsConfig: Output?
        get() = javaResource.linuxOsConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> kubernetesClusterNodePoolLinuxOsConfigToKotlin(args0) })
            }).orElse(null)
        })

    public val maxCount: Output?
        get() = javaResource.maxCount().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The maximum number of pods that can run on each agent. Changing this forces a new resource to be created.
     */
    public val maxPods: Output
        get() = javaResource.maxPods().applyValue({ args0 -> args0 })

    /**
     * A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It cannot be specified for Windows nodes and must be a static string (i.e. will be printed raw and not executed as a script). Changing this forces a new resource to be created.
     */
    public val messageOfTheDay: Output?
        get() = javaResource.messageOfTheDay().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val minCount: Output?
        get() = javaResource.minCount().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Should this Node Pool be used for System or User resources? Possible values are `System` and `User`. Defaults to `User`.
     */
    public val mode: Output?
        get() = javaResource.mode().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the Node Pool which should be created within the Kubernetes Cluster. Changing this forces a new resource to be created.
     * > **NOTE:** A Windows Node Pool cannot have a `name` longer than 6 characters.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val nodeCount: Output
        get() = javaResource.nodeCount().applyValue({ args0 -> args0 })

    /**
     * A map of Kubernetes labels which should be applied to nodes in this Node Pool.
     */
    public val nodeLabels: Output>
        get() = javaResource.nodeLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A `node_network_profile` block as documented below.
     */
    public val nodeNetworkProfile: Output?
        get() = javaResource.nodeNetworkProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    kubernetesClusterNodePoolNodeNetworkProfileToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Resource ID for the Public IP Addresses Prefix for the nodes in this Node Pool. `enable_node_public_ip` should be `true`. Changing this forces a new resource to be created.
     */
    public val nodePublicIpPrefixId: Output?
        get() = javaResource.nodePublicIpPrefixId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A list of Kubernetes taints which should be applied to nodes in the agent pool (e.g `key=value:NoSchedule`).
     */
    public val nodeTaints: Output>?
        get() = javaResource.nodeTaints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * Version of Kubernetes used for the Agents. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as `1.22` are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in [the documentation](https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version).
     * > **Note:** This version must be supported by the Kubernetes Cluster - as such the version of Kubernetes used on the Cluster/Control Plane may need to be upgraded first.
     */
    public val orchestratorVersion: Output
        get() = javaResource.orchestratorVersion().applyValue({ args0 -> args0 })

    /**
     * The Agent Operating System disk size in GB. Changing this forces a new resource to be created.
     */
    public val osDiskSizeGb: Output
        get() = javaResource.osDiskSizeGb().applyValue({ args0 -> args0 })

    /**
     * The type of disk which should be used for the Operating System. Possible values are `Ephemeral` and `Managed`. Defaults to `Managed`. Changing this forces a new resource to be created.
     */
    public val osDiskType: Output?
        get() = javaResource.osDiskType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the OS SKU used by the agent pool. Possible values are `AzureLinux`, `Ubuntu`, `Windows2019` and `Windows2022`. If not specified, the default is `Ubuntu` if OSType=Linux or `Windows2019` if OSType=Windows. And the default Windows OSSKU will be changed to `Windows2022` after Windows2019 is deprecated. Changing this from `AzureLinux` or `Ubuntu` to `AzureLinux` or `Ubuntu` will not replace the resource, otherwise it forces a new resource to be created.
     */
    public val osSku: Output
        get() = javaResource.osSku().applyValue({ args0 -> args0 })

    /**
     * The Operating System which should be used for this Node Pool. Changing this forces a new resource to be created. Possible values are `Linux` and `Windows`. Defaults to `Linux`.
     */
    public val osType: Output?
        get() = javaResource.osType().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the Subnet where the pods in the Node Pool should exist. Changing this forces a new resource to be created.
     */
    public val podSubnetId: Output?
        get() = javaResource.podSubnetId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Priority for Virtual Machines within the Virtual Machine Scale Set that powers this Node Pool. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created.
     */
    public val priority: Output?
        get() = javaResource.priority().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the Proximity Placement Group where the Virtual Machine Scale Set that powers this Node Pool will be placed. Changing this forces a new resource to be created.
     * > **Note:** When setting `priority` to Spot - you must configure an `eviction_policy`, `spot_max_price` and add the applicable `node_labels` and `node_taints` [as per the Azure Documentation](https://docs.microsoft.com/azure/aks/spot-node-pool).
     */
    public val proximityPlacementGroupId: Output?
        get() = javaResource.proximityPlacementGroupId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies how the node pool should deal with scaled-down nodes. Allowed values are `Delete` and `Deallocate`. Defaults to `Delete`.
     */
    public val scaleDownMode: Output?
        get() = javaResource.scaleDownMode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Snapshot which should be used to create this Node Pool. Changing this forces a new resource to be created.
     */
    public val snapshotId: Output?
        get() = javaResource.snapshotId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The maximum price you're willing to pay in USD per Virtual Machine. Valid values are `-1` (the current on-demand price for a Virtual Machine) or a positive value with up to five decimal places. Changing this forces a new resource to be created.
     * > **Note:** This field can only be configured when `priority` is set to `Spot`.
     */
    public val spotMaxPrice: Output?
        get() = javaResource.spotMaxPrice().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A mapping of tags to assign to the resource.
     * > At this time there's a bug in the AKS API where Tags for a Node Pool are not stored in the correct case - you may wish to use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) functionality to ignore changes to the casing until this is fixed in the AKS API.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Used to specify whether the UltraSSD is enabled in the Node Pool. Defaults to `false`. See [the documentation](https://docs.microsoft.com/azure/aks/use-ultra-disks) for more information. Changing this forces a new resource to be created.
     */
    public val ultraSsdEnabled: Output?
        get() = javaResource.ultraSsdEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `upgrade_settings` block as documented below.
     */
    public val upgradeSettings: Output?
        get() = javaResource.upgradeSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    kubernetesClusterNodePoolUpgradeSettingsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The SKU which should be used for the Virtual Machines used in this Node Pool. Changing this forces a new resource to be created.
     */
    public val vmSize: Output
        get() = javaResource.vmSize().applyValue({ args0 -> args0 })

    /**
     * The ID of the Subnet where this Node Pool should exist. Changing this forces a new resource to be created.
     * > **NOTE:** A route table must be configured on this Subnet.
     */
    public val vnetSubnetId: Output?
        get() = javaResource.vnetSubnetId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `windows_profile` block as documented below. Changing this forces a new resource to be created.
     */
    public val windowsProfile: Output?
        get() = javaResource.windowsProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    kubernetesClusterNodePoolWindowsProfileToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Used to specify the workload runtime. Allowed values are `OCIContainer`, `WasmWasi` and `KataMshvVmIsolation`.
     * > **Note:** WebAssembly System Interface node pools are in Public Preview - more information and details on how to opt into the preview can be found in [this article](https://docs.microsoft.com/azure/aks/use-wasi-node-pools)
     * > **Note:** Pod Sandboxing / KataVM Isolation node pools are in Public Preview - more information and details on how to opt into the preview can be found in [this article](https://learn.microsoft.com/azure/aks/use-pod-sandboxing)
     */
    public val workloadRuntime: Output?
        get() = javaResource.workloadRuntime().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies a list of Availability Zones in which this Kubernetes Cluster Node Pool should be located. Changing this forces a new Kubernetes Cluster Node Pool to be created.
     */
    public val zones: Output>?
        get() = javaResource.zones().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

public object KubernetesClusterNodePoolMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.containerservice.KubernetesClusterNodePool::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy