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

com.pulumi.azure.arckubernetes.kotlin.ClusterExtensionArgs.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.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.arckubernetes.kotlin

import com.pulumi.azure.arckubernetes.ClusterExtensionArgs.builder
import com.pulumi.azure.arckubernetes.kotlin.inputs.ClusterExtensionIdentityArgs
import com.pulumi.azure.arckubernetes.kotlin.inputs.ClusterExtensionIdentityArgsBuilder
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 an Arc Kubernetes Cluster Extension.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleCluster = new azure.arckubernetes.Cluster("example", {
 *     name: "example-akcc",
 *     resourceGroupName: example.name,
 *     location: "West Europe",
 *     agentPublicKeyCertificate: std.filebase64({
 *         input: "testdata/public.cer",
 *     }).then(invoke => invoke.result),
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 *     tags: {
 *         ENV: "Test",
 *     },
 * });
 * const exampleClusterExtension = new azure.arckubernetes.ClusterExtension("example", {
 *     name: "example-ext",
 *     clusterId: exampleCluster.id,
 *     extensionType: "microsoft.flux",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_cluster = azure.arckubernetes.Cluster("example",
 *     name="example-akcc",
 *     resource_group_name=example.name,
 *     location="West Europe",
 *     agent_public_key_certificate=std.filebase64(input="testdata/public.cer").result,
 *     identity=azure.arckubernetes.ClusterIdentityArgs(
 *         type="SystemAssigned",
 *     ),
 *     tags={
 *         "ENV": "Test",
 *     })
 * example_cluster_extension = azure.arckubernetes.ClusterExtension("example",
 *     name="example-ext",
 *     cluster_id=example_cluster.id,
 *     extension_type="microsoft.flux")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleCluster = new Azure.ArcKubernetes.Cluster("example", new()
 *     {
 *         Name = "example-akcc",
 *         ResourceGroupName = example.Name,
 *         Location = "West Europe",
 *         AgentPublicKeyCertificate = Std.Filebase64.Invoke(new()
 *         {
 *             Input = "testdata/public.cer",
 *         }).Apply(invoke => invoke.Result),
 *         Identity = new Azure.ArcKubernetes.Inputs.ClusterIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *         Tags =
 *         {
 *             { "ENV", "Test" },
 *         },
 *     });
 *     var exampleClusterExtension = new Azure.ArcKubernetes.ClusterExtension("example", new()
 *     {
 *         Name = "example-ext",
 *         ClusterId = exampleCluster.Id,
 *         ExtensionType = "microsoft.flux",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arckubernetes"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"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
 * 		}
 * 		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
 * 			Input: "testdata/public.cer",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleCluster, err := arckubernetes.NewCluster(ctx, "example", &arckubernetes.ClusterArgs{
 * 			Name:                      pulumi.String("example-akcc"),
 * 			ResourceGroupName:         example.Name,
 * 			Location:                  pulumi.String("West Europe"),
 * 			AgentPublicKeyCertificate: invokeFilebase64.Result,
 * 			Identity: &arckubernetes.ClusterIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"ENV": pulumi.String("Test"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = arckubernetes.NewClusterExtension(ctx, "example", &arckubernetes.ClusterExtensionArgs{
 * 			Name:          pulumi.String("example-ext"),
 * 			ClusterId:     exampleCluster.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.arckubernetes.Cluster;
 * import com.pulumi.azure.arckubernetes.ClusterArgs;
 * import com.pulumi.azure.arckubernetes.inputs.ClusterIdentityArgs;
 * import com.pulumi.azure.arckubernetes.ClusterExtension;
 * import com.pulumi.azure.arckubernetes.ClusterExtensionArgs;
 * 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 exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
 *             .name("example-akcc")
 *             .resourceGroupName(example.name())
 *             .location("West Europe")
 *             .agentPublicKeyCertificate(StdFunctions.filebase64(Filebase64Args.builder()
 *                 .input("testdata/public.cer")
 *                 .build()).result())
 *             .identity(ClusterIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .tags(Map.of("ENV", "Test"))
 *             .build());
 *         var exampleClusterExtension = new ClusterExtension("exampleClusterExtension", ClusterExtensionArgs.builder()
 *             .name("example-ext")
 *             .clusterId(exampleCluster.id())
 *             .extensionType("microsoft.flux")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleCluster:
 *     type: azure:arckubernetes:Cluster
 *     name: example
 *     properties:
 *       name: example-akcc
 *       resourceGroupName: ${example.name}
 *       location: West Europe
 *       agentPublicKeyCertificate:
 *         fn::invoke:
 *           Function: std:filebase64
 *           Arguments:
 *             input: testdata/public.cer
 *           Return: result
 *       identity:
 *         type: SystemAssigned
 *       tags:
 *         ENV: Test
 *   exampleClusterExtension:
 *     type: azure:arckubernetes:ClusterExtension
 *     name: example
 *     properties:
 *       name: example-ext
 *       clusterId: ${exampleCluster.id}
 *       extensionType: microsoft.flux
 * ```
 * 
 * ## Import
 * Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g.
 * ```sh
 * $ pulumi import azure:arckubernetes/clusterExtension:ClusterExtension example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Kubernetes/connectedClusters/cluster1/providers/Microsoft.KubernetesConfiguration/extensions/extension1
 * ```
 * @property clusterId Specifies the Cluster ID. Changing this forces a new Arc 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 Arc-enabled Kubernetes clusters](https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/extensions-release). Changing this forces a new Arc Kubernetes Cluster Extension to be created.
 * @property identity An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
 * @property name Specifies the name which should be used for this Arc Kubernetes Cluster Extension. Changing this forces a new Arc Kubernetes Cluster Extension 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 Arc 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 Arc 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 Arc 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 Arc Kubernetes Cluster Extension to be created.
 */
public data class ClusterExtensionArgs(
    public val clusterId: Output? = null,
    public val configurationProtectedSettings: Output>? = null,
    public val configurationSettings: Output>? = null,
    public val extensionType: Output? = null,
    public val identity: Output? = null,
    public val name: 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.arckubernetes.ClusterExtensionArgs =
        com.pulumi.azure.arckubernetes.ClusterExtensionArgs.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 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .releaseNamespace(releaseNamespace?.applyValue({ args0 -> args0 }))
            .releaseTrain(releaseTrain?.applyValue({ args0 -> args0 }))
            .targetNamespace(targetNamespace?.applyValue({ args0 -> args0 }))
            .version(version?.applyValue({ args0 -> args0 })).build()
}

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

    private var configurationProtectedSettings: Output>? = null

    private var configurationSettings: Output>? = null

    private var extensionType: Output? = null

    private var identity: Output? = null

    private var name: 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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("qehlsqaogrmvfubt")
    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("crhxpchhbxlvjkww")
    public suspend fun configurationProtectedSettings(`value`: Output>) {
        this.configurationProtectedSettings = value
    }

    /**
     * @param value Configuration settings, as name-value pairs for configuring this extension.
     */
    @JvmName("stqsvyjabyprwdwo")
    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 Arc-enabled Kubernetes clusters](https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/extensions-release). Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("abiopnxmoaunbgeu")
    public suspend fun extensionType(`value`: Output) {
        this.extensionType = value
    }

    /**
     * @param value An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("afomfoqjbpjjgjqa")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Specifies the name which should be used for this Arc Kubernetes Cluster Extension. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("gsmkkmwhaqwfdjgl")
    public suspend fun name(`value`: Output) {
        this.name = 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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("cxbmsqlcllndettu")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("pwcmujipxlfvengn")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("edgwswhxwuefbjda")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("xamaixonrkefbofm")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value Specifies the Cluster ID. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("yuquvnkljuxwcutc")
    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("jrswpnkuiotgmnec")
    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("vywsqbffkimfbjms")
    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("rolsmcqosoxohuev")
    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("ulpffiibfbtrhect")
    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 Arc-enabled Kubernetes clusters](https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/extensions-release). Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("ifvlyyoaenuxbfvd")
    public suspend fun extensionType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.extensionType = mapped
    }

    /**
     * @param value An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("qcujpmeopdshgdwb")
    public suspend fun identity(`value`: ClusterExtensionIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("jwmnuycdlrcifxsg")
    public suspend fun identity(argument: suspend ClusterExtensionIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterExtensionIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Specifies the name which should be used for this Arc Kubernetes Cluster Extension. Changing this forces a new Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("ilvmltpwookurqep")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = 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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("awxdtpqilhmeqxyu")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("sdbxuvwqdirmqnrn")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("kjovrvlhlkujvevu")
    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 Arc Kubernetes Cluster Extension to be created.
     */
    @JvmName("mhawnfanfyasexgl")
    public suspend fun version(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.version = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy