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

com.pulumi.azure.bot.kotlin.WebApp.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.bot.kotlin

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.List
import kotlin.collections.Map

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

    public var args: WebAppArgs = WebAppArgs()

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

/**
 * Manages a Bot Web App.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleWebApp = new azure.bot.WebApp("example", {
 *     name: "example",
 *     location: "global",
 *     resourceGroupName: example.name,
 *     sku: "F0",
 *     microsoftAppId: current.then(current => current.clientId),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * current = azure.core.get_client_config()
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_web_app = azure.bot.WebApp("example",
 *     name="example",
 *     location="global",
 *     resource_group_name=example.name,
 *     sku="F0",
 *     microsoft_app_id=current.client_id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleWebApp = new Azure.Bot.WebApp("example", new()
 *     {
 *         Name = "example",
 *         Location = "global",
 *         ResourceGroupName = example.Name,
 *         Sku = "F0",
 *         MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot"
 * 	"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 {
 * 		current, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bot.NewWebApp(ctx, "example", &bot.WebAppArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          pulumi.String("global"),
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("F0"),
 * 			MicrosoftAppId:    pulumi.String(current.ClientId),
 * 		})
 * 		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.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.bot.WebApp;
 * import com.pulumi.azure.bot.WebAppArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleWebApp = new WebApp("exampleWebApp", WebAppArgs.builder()
 *             .name("example")
 *             .location("global")
 *             .resourceGroupName(example.name())
 *             .sku("F0")
 *             .microsoftAppId(current.applyValue(getClientConfigResult -> getClientConfigResult.clientId()))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleWebApp:
 *     type: azure:bot:WebApp
 *     name: example
 *     properties:
 *       name: example
 *       location: global
 *       resourceGroupName: ${example.name}
 *       sku: F0
 *       microsoftAppId: ${current.clientId}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Bot Web App's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:bot/webApp:WebApp example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.BotService/botServices/example
 * ```
 */
public class WebApp internal constructor(
    override val javaResource: com.pulumi.azure.bot.WebApp,
) : KotlinCustomResource(javaResource, WebAppMapper) {
    /**
     * The Application Insights API Key to associate with the Web App Bot.
     */
    public val developerAppInsightsApiKey: Output?
        get() = javaResource.developerAppInsightsApiKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Application Insights Application ID to associate with the Web App Bot.
     */
    public val developerAppInsightsApplicationId: Output?
        get() = javaResource.developerAppInsightsApplicationId().applyValue({ args0 ->
            args0.map({ args0 -> args0 }).orElse(null)
        })

    /**
     * The Application Insights Key to associate with the Web App Bot.
     */
    public val developerAppInsightsKey: Output?
        get() = javaResource.developerAppInsightsKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the Web App Bot will be displayed as. This defaults to `name` if not specified.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * The Web App Bot endpoint.
     */
    public val endpoint: Output?
        get() = javaResource.endpoint().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * A list of LUIS App IDs to associate with the Web App Bot.
     */
    public val luisAppIds: Output>?
        get() = javaResource.luisAppIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The LUIS key to associate with the Web App Bot.
     */
    public val luisKey: Output?
        get() = javaResource.luisKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Microsoft Application ID for the Web App Bot. Changing this forces a new resource to be created.
     */
    public val microsoftAppId: Output
        get() = javaResource.microsoftAppId().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of the Web App Bot. Changing this forces a new resource to be created. Must be globally unique.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the resource group in which to create the Web App Bot. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * The SKU of the Web App Bot. Valid values include `F0` or `S1`. Changing this forces a new resource to be created.
     */
    public val sku: Output
        get() = javaResource.sku().applyValue({ args0 -> args0 })

    /**
     * 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)
        })
}

public object WebAppMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.bot.WebApp::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy