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

com.pulumi.azure.kusto.kotlin.Cluster.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.kusto.kotlin

import com.pulumi.azure.kusto.kotlin.outputs.ClusterIdentity
import com.pulumi.azure.kusto.kotlin.outputs.ClusterOptimizedAutoScale
import com.pulumi.azure.kusto.kotlin.outputs.ClusterSku
import com.pulumi.azure.kusto.kotlin.outputs.ClusterVirtualNetworkConfiguration
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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.kusto.kotlin.outputs.ClusterIdentity.Companion.toKotlin as clusterIdentityToKotlin
import com.pulumi.azure.kusto.kotlin.outputs.ClusterOptimizedAutoScale.Companion.toKotlin as clusterOptimizedAutoScaleToKotlin
import com.pulumi.azure.kusto.kotlin.outputs.ClusterSku.Companion.toKotlin as clusterSkuToKotlin
import com.pulumi.azure.kusto.kotlin.outputs.ClusterVirtualNetworkConfiguration.Companion.toKotlin as clusterVirtualNetworkConfigurationToKotlin

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

    public var args: ClusterArgs = ClusterArgs()

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

/**
 * Manages a Kusto (also known as Azure Data Explorer) Cluster
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "my-kusto-cluster-rg",
 *     location: "West Europe",
 * });
 * const exampleCluster = new azure.kusto.Cluster("example", {
 *     name: "kustocluster",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: {
 *         name: "Standard_D13_v2",
 *         capacity: 2,
 *     },
 *     tags: {
 *         Environment: "Production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="my-kusto-cluster-rg",
 *     location="West Europe")
 * example_cluster = azure.kusto.Cluster("example",
 *     name="kustocluster",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku={
 *         "name": "Standard_D13_v2",
 *         "capacity": 2,
 *     },
 *     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 = "my-kusto-cluster-rg",
 *         Location = "West Europe",
 *     });
 *     var exampleCluster = new Azure.Kusto.Cluster("example", new()
 *     {
 *         Name = "kustocluster",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = new Azure.Kusto.Inputs.ClusterSkuArgs
 *         {
 *             Name = "Standard_D13_v2",
 *             Capacity = 2,
 *         },
 *         Tags =
 *         {
 *             { "Environment", "Production" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto"
 * 	"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("my-kusto-cluster-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = kusto.NewCluster(ctx, "example", &kusto.ClusterArgs{
 * 			Name:              pulumi.String("kustocluster"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku: &kusto.ClusterSkuArgs{
 * 				Name:     pulumi.String("Standard_D13_v2"),
 * 				Capacity: pulumi.Int(2),
 * 			},
 * 			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.kusto.Cluster;
 * import com.pulumi.azure.kusto.ClusterArgs;
 * import com.pulumi.azure.kusto.inputs.ClusterSkuArgs;
 * 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("my-kusto-cluster-rg")
 *             .location("West Europe")
 *             .build());
 *         var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
 *             .name("kustocluster")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku(ClusterSkuArgs.builder()
 *                 .name("Standard_D13_v2")
 *                 .capacity(2)
 *                 .build())
 *             .tags(Map.of("Environment", "Production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: my-kusto-cluster-rg
 *       location: West Europe
 *   exampleCluster:
 *     type: azure:kusto:Cluster
 *     name: example
 *     properties:
 *       name: kustocluster
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku:
 *         name: Standard_D13_v2
 *         capacity: 2
 *       tags:
 *         Environment: Production
 * ```
 * 
 * ## Import
 * Kusto Clusters can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:kusto/cluster:Cluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1
 * ```
 */
public class Cluster internal constructor(
    override val javaResource: com.pulumi.azure.kusto.Cluster,
) : KotlinCustomResource(javaResource, ClusterMapper) {
    /**
     * List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster.
     */
    public val allowedFqdns: Output>?
        get() = javaResource.allowedFqdns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The list of ips in the format of CIDR allowed to connect to the cluster.
     */
    public val allowedIpRanges: Output>?
        get() = javaResource.allowedIpRanges().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies if the cluster could be automatically stopped (due to lack of data or no activity for many days). Defaults to `true`.
     */
    public val autoStopEnabled: Output?
        get() = javaResource.autoStopEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Kusto Cluster URI to be used for data ingestion.
     */
    public val dataIngestionUri: Output
        get() = javaResource.dataIngestionUri().applyValue({ args0 -> args0 })

    /**
     * Specifies if the cluster's disks are encrypted.
     */
    public val diskEncryptionEnabled: Output?
        get() = javaResource.diskEncryptionEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Is the cluster's double encryption enabled? Changing this forces a new resource to be created.
     */
    public val doubleEncryptionEnabled: Output?
        get() = javaResource.doubleEncryptionEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    @Deprecated(
        message = """
  This property has been deprecated as it will no longer be supported by the API. It will be removed
      in v4.0 of the AzureRM Provider.
  """,
    )
    public val engine: Output?
        get() = javaResource.engine().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * An `identity` block as defined below.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    clusterIdentityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * An list of `language_extensions` to enable. Valid values are: `PYTHON`, `PYTHON_3.10.8` and `R`. `PYTHON` is used to specify Python 3.6.5 image and `PYTHON_3.10.8` is used to specify Python 3.10.8 image. Note that `PYTHON_3.10.8` is only available in skus which support nested virtualization.
     * > **NOTE:** In `v4.0.0` and later version of the AzureRM Provider, `language_extensions` will be changed to a list of `language_extension` block. In each block, `name` and `image` are required. `name` is the name of the language extension, possible values are `PYTHON`, `R`. `image` is the image of the language extension, possible values are `Python3_6_5`, `Python3_10_8` and `R`.
     */
    public val languageExtensions: Output>?
        get() = javaResource.languageExtensions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name of the Kusto Cluster to create. Only lowercase Alphanumeric characters allowed, starting with a letter. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * An `optimized_auto_scale` block as defined below.
     */
    public val optimizedAutoScale: Output?
        get() = javaResource.optimizedAutoScale().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> clusterOptimizedAutoScaleToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Whether to restrict outbound network access. Value is optional but if passed in, must be `true` or `false`, default is `false`.
     */
    public val outboundNetworkAccessRestricted: Output?
        get() = javaResource.outboundNetworkAccessRestricted().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). Defaults to `IPv4`.
     */
    public val publicIpType: Output?
        get() = javaResource.publicIpType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Is the public network access enabled? Defaults to `true`.
     */
    public val publicNetworkAccessEnabled: Output?
        get() = javaResource.publicNetworkAccessEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies if the purge operations are enabled.
     */
    public val purgeEnabled: Output?
        get() = javaResource.purgeEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A `sku` block as defined below.
     */
    public val sku: Output
        get() = javaResource.sku().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterSkuToKotlin(args0)
            })
        })

    /**
     * Specifies if the streaming ingest is enabled.
     */
    public val streamingIngestionEnabled: Output?
        get() = javaResource.streamingIngestionEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies a list of tenant IDs that are trusted by the cluster. Default setting trusts all other tenants. Use `trusted_external_tenants = ["*"]` to explicitly allow all other tenants, `trusted_external_tenants = ["MyTenantOnly"]` for only your tenant or `trusted_external_tenants = ["", ""]` to allow specific other tenants.
     * > **NOTE:** In v3.0 of `azurerm` a new or updated Kusto Cluster will only allow your own tenant by default. Explicit configuration of this setting will change from `trusted_external_tenants = ["MyTenantOnly"]` to `trusted_external_tenants = []`.
     */
    public val trustedExternalTenants: Output>
        get() = javaResource.trustedExternalTenants().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The FQDN of the Azure Kusto Cluster.
     */
    public val uri: Output
        get() = javaResource.uri().applyValue({ args0 -> args0 })

    /**
     * A `virtual_network_configuration` block as defined below.
     * > **NOTE:** Currently removing `virtual_network_configuration` sets the `virtual_network_configuration` to `Disabled` state. But any changes to `virtual_network_configuration` in `Disabled` state forces a new resource to be created.
     */
    public val virtualNetworkConfiguration: Output?
        get() = javaResource.virtualNetworkConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> clusterVirtualNetworkConfigurationToKotlin(args0) })
            }).orElse(null)
        })

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

public object ClusterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.kusto.Cluster::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy