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

com.pulumi.azure.containerservice.kotlin.KubernetesClusterExtensionArgs.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.containerservice.kotlin

import com.pulumi.azure.containerservice.KubernetesClusterExtensionArgs.builder
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterExtensionPlanArgs
import com.pulumi.azure.containerservice.kotlin.inputs.KubernetesClusterExtensionPlanArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Kubernetes Cluster Extension.
 * ## 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 exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
 *     name: "example-aks",
 *     location: "West Europe",
 *     resourceGroupName: example.name,
 *     dnsPrefix: "example-aks",
 *     defaultNodePool: {
 *         name: "default",
 *         nodeCount: 1,
 *         vmSize: "Standard_DS2_v2",
 *     },
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleKubernetesClusterExtension = new azure.containerservice.KubernetesClusterExtension("example", {
 *     name: "example-ext",
 *     clusterId: exampleKubernetesCluster.id,
 *     extensionType: "microsoft.flux",
 * });
 * ```
 * ```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-aks",
 *     location="West Europe",
 *     resource_group_name=example.name,
 *     dns_prefix="example-aks",
 *     default_node_pool={
 *         "name": "default",
 *         "node_count": 1,
 *         "vm_size": "Standard_DS2_v2",
 *     },
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_kubernetes_cluster_extension = azure.containerservice.KubernetesClusterExtension("example",
 *     name="example-ext",
 *     cluster_id=example_kubernetes_cluster.id,
 *     extension_type="microsoft.flux")
 * ```
 * ```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-aks",
 *         Location = "West Europe",
 *         ResourceGroupName = example.Name,
 *         DnsPrefix = "example-aks",
 *         DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
 *         {
 *             Name = "default",
 *             NodeCount = 1,
 *             VmSize = "Standard_DS2_v2",
 *         },
 *         Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleKubernetesClusterExtension = new Azure.ContainerService.KubernetesClusterExtension("example", new()
 *     {
 *         Name = "example-ext",
 *         ClusterId = exampleKubernetesCluster.Id,
 *         ExtensionType = "microsoft.flux",
 *     });
 * });
 * ```
 * ```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-aks"),
 * 			Location:          pulumi.String("West Europe"),
 * 			ResourceGroupName: example.Name,
 * 			DnsPrefix:         pulumi.String("example-aks"),
 * 			DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
 * 				Name:      pulumi.String("default"),
 * 				NodeCount: pulumi.Int(1),
 * 				VmSize:    pulumi.String("Standard_DS2_v2"),
 * 			},
 * 			Identity: &containerservice.KubernetesClusterIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = containerservice.NewKubernetesClusterExtension(ctx, "example", &containerservice.KubernetesClusterExtensionArgs{
 * 			Name:          pulumi.String("example-ext"),
 * 			ClusterId:     exampleKubernetesCluster.ID(),
 * 			ExtensionType: pulumi.String("microsoft.flux"),
 * 		})
 * 		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.KubernetesClusterIdentityArgs;
 * import com.pulumi.azure.containerservice.KubernetesClusterExtension;
 * import com.pulumi.azure.containerservice.KubernetesClusterExtensionArgs;
 * 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-aks")
 *             .location("West Europe")
 *             .resourceGroupName(example.name())
 *             .dnsPrefix("example-aks")
 *             .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
 *                 .name("default")
 *                 .nodeCount(1)
 *                 .vmSize("Standard_DS2_v2")
 *                 .build())
 *             .identity(KubernetesClusterIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleKubernetesClusterExtension = new KubernetesClusterExtension("exampleKubernetesClusterExtension", KubernetesClusterExtensionArgs.builder()
 *             .name("example-ext")
 *             .clusterId(exampleKubernetesCluster.id())
 *             .extensionType("microsoft.flux")
 *             .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-aks
 *       location: West Europe
 *       resourceGroupName: ${example.name}
 *       dnsPrefix: example-aks
 *       defaultNodePool:
 *         name: default
 *         nodeCount: 1
 *         vmSize: Standard_DS2_v2
 *       identity:
 *         type: SystemAssigned
 *   exampleKubernetesClusterExtension:
 *     type: azure:containerservice:KubernetesClusterExtension
 *     name: example
 *     properties:
 *       name: example-ext
 *       clusterId: ${exampleKubernetesCluster.id}
 *       extensionType: microsoft.flux
 * ```
 * 
 * ## Import
 * Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g.
 * ```sh
 * $ pulumi import azure:containerservice/kubernetesClusterExtension:KubernetesClusterExtension example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1/providers/Microsoft.KubernetesConfiguration/extensions/extension1
 * ```
 * @property clusterId Specifies the Cluster ID. Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property configurationProtectedSettings Configuration settings that are sensitive, as name-value pairs for configuring this extension.
 * @property configurationSettings Configuration settings, as name-value pairs for configuring this extension.
 * @property extensionType Specifies the type of extension. It must be one of the extension types registered with Microsoft.KubernetesConfiguration by the Extension publisher. For more information, please refer to [Available Extensions for AKS](https://learn.microsoft.com/en-us/azure/aks/cluster-extensions?tabs=azure-cli#currently-available-extensions). Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property name Specifies the name which should be used for this Kubernetes Cluster Extension. Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property plan A `plan` block as defined below. Changing this forces a new resource to be created.
 * @property releaseNamespace Namespace where the extension release must be placed for a cluster scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property releaseTrain The release train used by this extension. Possible values include but are not limited to `Stable`, `Preview`. Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property targetNamespace Namespace where the extension will be created for a namespace scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
 * @property version User-specified version that the extension should pin to. If it is not set, Azure will use the latest version and auto upgrade it. Changing this forces a new Kubernetes Cluster Extension to be created.
 */
public data class KubernetesClusterExtensionArgs(
    public val clusterId: Output? = null,
    public val configurationProtectedSettings: Output>? = null,
    public val configurationSettings: Output>? = null,
    public val extensionType: Output? = null,
    public val name: Output? = null,
    public val plan: Output? = null,
    public val releaseNamespace: Output? = null,
    public val releaseTrain: Output? = null,
    public val targetNamespace: Output? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.containerservice.KubernetesClusterExtensionArgs =
        com.pulumi.azure.containerservice.KubernetesClusterExtensionArgs.builder()
            .clusterId(clusterId?.applyValue({ args0 -> args0 }))
            .configurationProtectedSettings(
                configurationProtectedSettings?.applyValue({ args0 ->
                    args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
                }),
            )
            .configurationSettings(
                configurationSettings?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .extensionType(extensionType?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .plan(plan?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .releaseNamespace(releaseNamespace?.applyValue({ args0 -> args0 }))
            .releaseTrain(releaseTrain?.applyValue({ args0 -> args0 }))
            .targetNamespace(targetNamespace?.applyValue({ args0 -> args0 }))
            .version(version?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [KubernetesClusterExtensionArgs].
 */
@PulumiTagMarker
public class KubernetesClusterExtensionArgsBuilder internal constructor() {
    private var clusterId: Output? = null

    private var configurationProtectedSettings: Output>? = null

    private var configurationSettings: Output>? = null

    private var extensionType: Output? = null

    private var name: Output? = null

    private var plan: Output? = null

    private var releaseNamespace: Output? = null

    private var releaseTrain: Output? = null

    private var targetNamespace: Output? = null

    private var version: Output? = null

    /**
     * @param value Specifies the Cluster ID. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("ohncysoeqcuyyobv")
    public suspend fun clusterId(`value`: Output) {
        this.clusterId = value
    }

    /**
     * @param value Configuration settings that are sensitive, as name-value pairs for configuring this extension.
     */
    @JvmName("gfpokadcxychdkjp")
    public suspend fun configurationProtectedSettings(`value`: Output>) {
        this.configurationProtectedSettings = value
    }

    /**
     * @param value Configuration settings, as name-value pairs for configuring this extension.
     */
    @JvmName("wjsyydiceaybrfby")
    public suspend fun configurationSettings(`value`: Output>) {
        this.configurationSettings = value
    }

    /**
     * @param value Specifies the type of extension. It must be one of the extension types registered with Microsoft.KubernetesConfiguration by the Extension publisher. For more information, please refer to [Available Extensions for AKS](https://learn.microsoft.com/en-us/azure/aks/cluster-extensions?tabs=azure-cli#currently-available-extensions). Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("okytouvuscatxbum")
    public suspend fun extensionType(`value`: Output) {
        this.extensionType = value
    }

    /**
     * @param value Specifies the name which should be used for this Kubernetes Cluster Extension. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("hppgmidyvqmwdojs")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A `plan` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("mpbbclckfkbymogc")
    public suspend fun plan(`value`: Output) {
        this.plan = value
    }

    /**
     * @param value Namespace where the extension release must be placed for a cluster scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("orobfmvkivlbeiol")
    public suspend fun releaseNamespace(`value`: Output) {
        this.releaseNamespace = value
    }

    /**
     * @param value The release train used by this extension. Possible values include but are not limited to `Stable`, `Preview`. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("chjduidfebcprmjh")
    public suspend fun releaseTrain(`value`: Output) {
        this.releaseTrain = value
    }

    /**
     * @param value Namespace where the extension will be created for a namespace scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("hbemvvlentsgtcja")
    public suspend fun targetNamespace(`value`: Output) {
        this.targetNamespace = value
    }

    /**
     * @param value User-specified version that the extension should pin to. If it is not set, Azure will use the latest version and auto upgrade it. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("xqmdpskvbtgcjnsm")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value Specifies the Cluster ID. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("ivndusdjbernwphm")
    public suspend fun clusterId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterId = mapped
    }

    /**
     * @param value Configuration settings that are sensitive, as name-value pairs for configuring this extension.
     */
    @JvmName("heaiuogeewllgdmj")
    public suspend fun configurationProtectedSettings(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configurationProtectedSettings = mapped
    }

    /**
     * @param values Configuration settings that are sensitive, as name-value pairs for configuring this extension.
     */
    @JvmName("isaswcfqgrmmnobo")
    public fun configurationProtectedSettings(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.configurationProtectedSettings = mapped
    }

    /**
     * @param value Configuration settings, as name-value pairs for configuring this extension.
     */
    @JvmName("unoughawwhprocdn")
    public suspend fun configurationSettings(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configurationSettings = mapped
    }

    /**
     * @param values Configuration settings, as name-value pairs for configuring this extension.
     */
    @JvmName("ntpksdnekfkboxfk")
    public fun configurationSettings(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.configurationSettings = mapped
    }

    /**
     * @param value Specifies the type of extension. It must be one of the extension types registered with Microsoft.KubernetesConfiguration by the Extension publisher. For more information, please refer to [Available Extensions for AKS](https://learn.microsoft.com/en-us/azure/aks/cluster-extensions?tabs=azure-cli#currently-available-extensions). Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("sxrempbmfxlduahu")
    public suspend fun extensionType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.extensionType = mapped
    }

    /**
     * @param value Specifies the name which should be used for this Kubernetes Cluster Extension. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("acwibwyomaioynuu")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A `plan` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("hyqlptyxfxnmibpi")
    public suspend fun plan(`value`: KubernetesClusterExtensionPlanArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.plan = mapped
    }

    /**
     * @param argument A `plan` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("pudgkxgnttolyisn")
    public suspend fun plan(argument: suspend KubernetesClusterExtensionPlanArgsBuilder.() -> Unit) {
        val toBeMapped = KubernetesClusterExtensionPlanArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.plan = mapped
    }

    /**
     * @param value Namespace where the extension release must be placed for a cluster scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("ngxpepckfuliqpkq")
    public suspend fun releaseNamespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.releaseNamespace = mapped
    }

    /**
     * @param value The release train used by this extension. Possible values include but are not limited to `Stable`, `Preview`. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("absxnqvxvahtrkob")
    public suspend fun releaseTrain(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.releaseTrain = mapped
    }

    /**
     * @param value Namespace where the extension will be created for a namespace scoped extension. If this namespace does not exist, it will be created. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("bbcckxawtswxwtao")
    public suspend fun targetNamespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetNamespace = mapped
    }

    /**
     * @param value User-specified version that the extension should pin to. If it is not set, Azure will use the latest version and auto upgrade it. Changing this forces a new Kubernetes Cluster Extension to be created.
     */
    @JvmName("ppdqhgmnvqunsksl")
    public suspend fun version(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.version = mapped
    }

    internal fun build(): KubernetesClusterExtensionArgs = KubernetesClusterExtensionArgs(
        clusterId = clusterId,
        configurationProtectedSettings = configurationProtectedSettings,
        configurationSettings = configurationSettings,
        extensionType = extensionType,
        name = name,
        plan = plan,
        releaseNamespace = releaseNamespace,
        releaseTrain = releaseTrain,
        targetNamespace = targetNamespace,
        version = version,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy