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

com.pulumi.azure.arckubernetes.kotlin.ClusterArgs.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.ClusterArgs.builder
import com.pulumi.azure.arckubernetes.kotlin.inputs.ClusterIdentityArgs
import com.pulumi.azure.arckubernetes.kotlin.inputs.ClusterIdentityArgsBuilder
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.
 * > **Note:** Installing and configuring the Azure Arc Agent on your Kubernetes Cluster to establish connectivity is outside the scope of this document. For more details refer to [Deploy agents to your cluster](https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/conceptual-agent-overview#deploy-agents-to-your-cluster) and [Connect an existing Kubernetes Cluster](https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster?tabs=azure-cli#connect-an-existing-kubernetes-cluster). If you encounter issues connecting your Kubernetes Cluster to Azure Arc, we'd recommend opening a ticket with Microsoft Support.
 * ## 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",
 *     },
 * });
 * ```
 * ```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",
 *     })
 * ```
 * ```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" },
 *         },
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		_, 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
 * 		}
 * 		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 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());
 *     }
 * }
 * ```
 * ```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
 * ```
 * 
 * > **Note:** An extensive example on connecting the `azure.arckubernetes.Cluster` to an external kubernetes cluster can be found in the `./examples/arckubernetes` directory within the GitHub Repository.
 * ## Import
 * Arc Kubernetes Cluster can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:arckubernetes/cluster:Cluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Kubernetes/connectedClusters/cluster1
 * ```
 * @property agentPublicKeyCertificate Specifies the base64-encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. Changing this forces a new Arc Kubernetes Cluster to be created.
 * @property identity An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster to be created.
 * @property location Specifies the Azure Region where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
 * @property name Specifies the name which should be used for this Arc Kubernetes Cluster. Changing this forces a new Arc Kubernetes Cluster to be created.
 * @property resourceGroupName Specifies the name of the Resource Group where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
 * @property tags A mapping of tags which should be assigned to the Arc Kubernetes Cluster.
 */
public data class ClusterArgs(
    public val agentPublicKeyCertificate: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.arckubernetes.ClusterArgs =
        com.pulumi.azure.arckubernetes.ClusterArgs.builder()
            .agentPublicKeyCertificate(agentPublicKeyCertificate?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ClusterArgs].
 */
@PulumiTagMarker
public class ClusterArgsBuilder internal constructor() {
    private var agentPublicKeyCertificate: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies the base64-encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("bessfofjrdcehuom")
    public suspend fun agentPublicKeyCertificate(`value`: Output) {
        this.agentPublicKeyCertificate = value
    }

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

    /**
     * @param value Specifies the Azure Region where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("jklfcbhirpelwgxp")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

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

    /**
     * @param value Specifies the name of the Resource Group where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("ychsmsgeoovhjqsd")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Arc Kubernetes Cluster.
     */
    @JvmName("acxudekqlblcbhqj")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the base64-encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("onaygrmcfwtobdvy")
    public suspend fun agentPublicKeyCertificate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.agentPublicKeyCertificate = mapped
    }

    /**
     * @param value An `identity` block as defined below. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("cbfijwxbkuclwjjn")
    public suspend fun identity(`value`: ClusterIdentityArgs?) {
        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 to be created.
     */
    @JvmName("eftkuerxtyirkpfi")
    public suspend fun identity(argument: suspend ClusterIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Specifies the Azure Region where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("pfmjqdebgggaexiw")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

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

    /**
     * @param value Specifies the name of the Resource Group where the Arc Kubernetes Cluster should exist. Changing this forces a new Arc Kubernetes Cluster to be created.
     */
    @JvmName("nfvwyebprrfbvjpg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Arc Kubernetes Cluster.
     */
    @JvmName("orhuhscnlqcnlxfl")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Arc Kubernetes Cluster.
     */
    @JvmName("csrqonkgthtlaidp")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ClusterArgs = ClusterArgs(
        agentPublicKeyCertificate = agentPublicKeyCertificate,
        identity = identity,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy