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

com.pulumi.azure.bot.kotlin.ChannelsRegistration.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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: ChannelsRegistrationArgs = ChannelsRegistrationArgs()

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

/**
 * Manages a Bot Channels Registration.
 * > **Note:** Bot Channels Registration has been [deprecated by Azure](https://learn.microsoft.com/en-us/azure/bot-service/bot-service-resources-faq-azure?view=azure-bot-service-4.0#why-are-web-app-bot-and-bot-channel-registration-being-deprecated). New implementations should use the `azure.bot.ServiceAzureBot` resource.
 * ## 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 exampleChannelsRegistration = new azure.bot.ChannelsRegistration("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_channels_registration = azure.bot.ChannelsRegistration("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 exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("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.NewChannelsRegistration(ctx, "example", &bot.ChannelsRegistrationArgs{
 * 			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.ChannelsRegistration;
 * import com.pulumi.azure.bot.ChannelsRegistrationArgs;
 * 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 exampleChannelsRegistration = new ChannelsRegistration("exampleChannelsRegistration", ChannelsRegistrationArgs.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
 *   exampleChannelsRegistration:
 *     type: azure:bot:ChannelsRegistration
 *     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 Channels Registration can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:bot/channelsRegistration:ChannelsRegistration example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.BotService/botServices/example
 * ```
 */
public class ChannelsRegistration internal constructor(
    override val javaResource: com.pulumi.azure.bot.ChannelsRegistration,
) : KotlinCustomResource(javaResource, ChannelsRegistrationMapper) {
    /**
     * The CMK Key Vault Key URL to encrypt the Bot Channels Registration with the Customer Managed Encryption Key.
     * > **Note:** It has to add the Key Vault Access Policy for the `Bot Service CMEK Prod` Service Principal and the `soft_delete_enabled` and the `purge_protection_enabled` is enabled on the `azure.keyvault.KeyVault` resource while using `cmk_key_vault_url`.
     * > **Note:** It has to turn off the CMK feature before revoking Key Vault Access Policy. For more information, please refer to [Revoke access to customer-managed keys](https://docs.microsoft.com/azure/bot-service/bot-service-encryption?view=azure-bot-service-4.0&WT.mc_id=Portal-Microsoft_Azure_BotService#revoke-access-to-customer-managed-keys).
     */
    public val cmkKeyVaultUrl: Output?
        get() = javaResource.cmkKeyVaultUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The description of the Bot Channels Registration.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

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

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

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

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

    /**
     * The icon URL to visually identify the Bot Channels Registration.
     */
    public val iconUrl: Output
        get() = javaResource.iconUrl().applyValue({ args0 -> args0 })

    /**
     * Is the Bot Channels Registration in an isolated network?
     * > **NOTE:** `isolated_network_enabled` is deprecated and will be removed in favour of the property `public_network_access_enabled` in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `isolated_network_enabled` will be removed in favour of the property
      `public_network_access_enabled` in version 4.0 of the AzureRM Provider.
  """,
    )
    public val isolatedNetworkEnabled: Output
        get() = javaResource.isolatedNetworkEnabled().applyValue({ args0 -> args0 })

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

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

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

    /**
     * Is the Bot Channels Registration in an isolated network?
     */
    public val publicNetworkAccessEnabled: Output
        get() = javaResource.publicNetworkAccessEnabled().applyValue({ args0 -> args0 })

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

    /**
     * The SKU of the Bot Channels Registration. 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 })

    /**
     * Is the streaming endpoint enabled for the Bot Channels Registration. Defaults to `false`.
     */
    public val streamingEndpointEnabled: Output?
        get() = javaResource.streamingEndpointEnabled().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)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy