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

com.pulumi.azure.elasticcloud.kotlin.Elasticsearch.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.elasticcloud.kotlin

import com.pulumi.azure.elasticcloud.kotlin.outputs.ElasticsearchLogs
import com.pulumi.azure.elasticcloud.kotlin.outputs.ElasticsearchLogs.Companion.toKotlin
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: ElasticsearchArgs = ElasticsearchArgs()

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

/**
 * Manages an Elasticsearch in Elastic Cloud.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const test = new azure.core.ResourceGroup("test", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const testElasticsearch = new azure.elasticcloud.Elasticsearch("test", {
 *     name: "example-elasticsearch",
 *     resourceGroupName: test.name,
 *     location: test.location,
 *     skuName: "ess-consumption-2024_Monthly",
 *     elasticCloudEmailAddress: "[email protected]",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * test = azure.core.ResourceGroup("test",
 *     name="example-resources",
 *     location="West Europe")
 * test_elasticsearch = azure.elasticcloud.Elasticsearch("test",
 *     name="example-elasticsearch",
 *     resource_group_name=test.name,
 *     location=test.location,
 *     sku_name="ess-consumption-2024_Monthly",
 *     elastic_cloud_email_address="[email protected]")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Azure.Core.ResourceGroup("test", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var testElasticsearch = new Azure.ElasticCloud.Elasticsearch("test", new()
 *     {
 *         Name = "example-elasticsearch",
 *         ResourceGroupName = test.Name,
 *         Location = test.Location,
 *         SkuName = "ess-consumption-2024_Monthly",
 *         ElasticCloudEmailAddress = "[email protected]",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/elasticcloud"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		test, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = elasticcloud.NewElasticsearch(ctx, "test", &elasticcloud.ElasticsearchArgs{
 * 			Name:                     pulumi.String("example-elasticsearch"),
 * 			ResourceGroupName:        test.Name,
 * 			Location:                 test.Location,
 * 			SkuName:                  pulumi.String("ess-consumption-2024_Monthly"),
 * 			ElasticCloudEmailAddress: pulumi.String("[email protected]"),
 * 		})
 * 		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.elasticcloud.Elasticsearch;
 * import com.pulumi.azure.elasticcloud.ElasticsearchArgs;
 * 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 test = new ResourceGroup("test", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var testElasticsearch = new Elasticsearch("testElasticsearch", ElasticsearchArgs.builder()
 *             .name("example-elasticsearch")
 *             .resourceGroupName(test.name())
 *             .location(test.location())
 *             .skuName("ess-consumption-2024_Monthly")
 *             .elasticCloudEmailAddress("[email protected]")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   testElasticsearch:
 *     type: azure:elasticcloud:Elasticsearch
 *     name: test
 *     properties:
 *       name: example-elasticsearch
 *       resourceGroupName: ${test.name}
 *       location: ${test.location}
 *       skuName: ess-consumption-2024_Monthly
 *       elasticCloudEmailAddress: [email protected]
 * ```
 * 
 * ## Import
 * Elasticsearch's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:elasticcloud/elasticsearch:Elasticsearch example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Elastic/monitors/monitor1
 * ```
 */
public class Elasticsearch internal constructor(
    override val javaResource: com.pulumi.azure.elasticcloud.Elasticsearch,
) : KotlinCustomResource(javaResource, ElasticsearchMapper) {
    /**
     * The ID of the Deployment within Elastic Cloud.
     */
    public val elasticCloudDeploymentId: Output
        get() = javaResource.elasticCloudDeploymentId().applyValue({ args0 -> args0 })

    /**
     * Specifies the Email Address which should be associated with this Elasticsearch account. Changing this forces a new Elasticsearch to be created.
     */
    public val elasticCloudEmailAddress: Output
        get() = javaResource.elasticCloudEmailAddress().applyValue({ args0 -> args0 })

    /**
     * The Default URL used for Single Sign On (SSO) to Elastic Cloud.
     */
    public val elasticCloudSsoDefaultUrl: Output
        get() = javaResource.elasticCloudSsoDefaultUrl().applyValue({ args0 -> args0 })

    /**
     * The ID of the User Account within Elastic Cloud.
     */
    public val elasticCloudUserId: Output
        get() = javaResource.elasticCloudUserId().applyValue({ args0 -> args0 })

    /**
     * The URL to the Elasticsearch Service associated with this Elasticsearch.
     */
    public val elasticsearchServiceUrl: Output
        get() = javaResource.elasticsearchServiceUrl().applyValue({ args0 -> args0 })

    /**
     * The URL to the Kibana Dashboard associated with this Elasticsearch.
     */
    public val kibanaServiceUrl: Output
        get() = javaResource.kibanaServiceUrl().applyValue({ args0 -> args0 })

    /**
     * The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
     */
    public val kibanaSsoUri: Output
        get() = javaResource.kibanaSsoUri().applyValue({ args0 -> args0 })

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

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

    /**
     * Specifies if the Elasticsearch should have monitoring configured? Defaults to `true`. Changing this forces a new Elasticsearch to be created.
     */
    public val monitoringEnabled: Output?
        get() = javaResource.monitoringEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name which should be used for this Elasticsearch resource. Changing this forces a new Elasticsearch to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * Specifies the name of the SKU for this Elasticsearch. Changing this forces a new Elasticsearch to be created.
     * > **NOTE:** The SKU depends on the Elasticsearch Plans available for your account and is a combination of PlanID_Term.
     * Ex: If the plan ID is "planXYZ" and term is "Yearly", the SKU will be "planXYZ_Yearly".
     * You may find your eligible plans [here](https://portal.azure.com/#view/Microsoft_Azure_Marketplace/GalleryItemDetailsBladeNopdl/id/elastic.ec-azure-pp) or in the online documentation [here](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/elastic.ec-azure-pp?tab=PlansAndPrice) for more details or in case of any issues with the SKU.
     */
    public val skuName: Output
        get() = javaResource.skuName().applyValue({ args0 -> args0 })

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

public object ElasticsearchMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.elasticcloud.Elasticsearch::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy