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

com.pulumi.azure.appservice.kotlin.FunctionAppHybridConnection.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.appservice.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: FunctionAppHybridConnectionArgs = FunctionAppHybridConnectionArgs()

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

/**
 * Manages a Function App Hybrid Connection.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleServicePlan = new azure.appservice.ServicePlan("example", {
 *     name: "example-plan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     osType: "Windows",
 *     skuName: "S1",
 * });
 * const exampleNamespace = new azure.relay.Namespace("example", {
 *     name: "example-relay",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "Standard",
 * });
 * const exampleHybridConnection = new azure.relay.HybridConnection("example", {
 *     name: "examplerhc1",
 *     resourceGroupName: example.name,
 *     relayNamespaceName: exampleNamespace.name,
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "storageaccountname",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     servicePlanId: exampleServicePlan.id,
 *     siteConfig: {},
 * });
 * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("example", {
 *     name: "example-function-app",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     servicePlanId: exampleServicePlan.id,
 *     storageAccountName: exampleAccount.name,
 *     storageAccountAccessKey: exampleAccount.primaryAccessKey,
 *     siteConfig: {},
 * });
 * const exampleFunctionAppHybridConnection = new azure.appservice.FunctionAppHybridConnection("example", {
 *     functionAppId: exampleWindowsWebApp.id,
 *     relayId: exampleHybridConnection.id,
 *     hostname: "myhostname.example",
 *     port: 8081,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg",
 *     location="West Europe")
 * example_service_plan = azure.appservice.ServicePlan("example",
 *     name="example-plan",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     os_type="Windows",
 *     sku_name="S1")
 * example_namespace = azure.relay.Namespace("example",
 *     name="example-relay",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="Standard")
 * example_hybrid_connection = azure.relay.HybridConnection("example",
 *     name="examplerhc1",
 *     resource_group_name=example.name,
 *     relay_namespace_name=example_namespace.name)
 * example_account = azure.storage.Account("example",
 *     name="storageaccountname",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="GRS")
 * example_windows_web_app = azure.appservice.WindowsWebApp("example",
 *     name="example",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     service_plan_id=example_service_plan.id,
 *     site_config={})
 * example_windows_function_app = azure.appservice.WindowsFunctionApp("example",
 *     name="example-function-app",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     service_plan_id=example_service_plan.id,
 *     storage_account_name=example_account.name,
 *     storage_account_access_key=example_account.primary_access_key,
 *     site_config={})
 * example_function_app_hybrid_connection = azure.appservice.FunctionAppHybridConnection("example",
 *     function_app_id=example_windows_web_app.id,
 *     relay_id=example_hybrid_connection.id,
 *     hostname="myhostname.example",
 *     port=8081)
 * ```
 * ```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 = "example-rg",
 *         Location = "West Europe",
 *     });
 *     var exampleServicePlan = new Azure.AppService.ServicePlan("example", new()
 *     {
 *         Name = "example-plan",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         OsType = "Windows",
 *         SkuName = "S1",
 *     });
 *     var exampleNamespace = new Azure.Relay.Namespace("example", new()
 *     {
 *         Name = "example-relay",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "Standard",
 *     });
 *     var exampleHybridConnection = new Azure.Relay.HybridConnection("example", new()
 *     {
 *         Name = "examplerhc1",
 *         ResourceGroupName = example.Name,
 *         RelayNamespaceName = exampleNamespace.Name,
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "storageaccountname",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "GRS",
 *     });
 *     var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("example", new()
 *     {
 *         Name = "example",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ServicePlanId = exampleServicePlan.Id,
 *         SiteConfig = null,
 *     });
 *     var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("example", new()
 *     {
 *         Name = "example-function-app",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ServicePlanId = exampleServicePlan.Id,
 *         StorageAccountName = exampleAccount.Name,
 *         StorageAccountAccessKey = exampleAccount.PrimaryAccessKey,
 *         SiteConfig = null,
 *     });
 *     var exampleFunctionAppHybridConnection = new Azure.AppService.FunctionAppHybridConnection("example", new()
 *     {
 *         FunctionAppId = exampleWindowsWebApp.Id,
 *         RelayId = exampleHybridConnection.Id,
 *         Hostname = "myhostname.example",
 *         Port = 8081,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"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-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleServicePlan, err := appservice.NewServicePlan(ctx, "example", &appservice.ServicePlanArgs{
 * 			Name:              pulumi.String("example-plan"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			OsType:            pulumi.String("Windows"),
 * 			SkuName:           pulumi.String("S1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNamespace, err := relay.NewNamespace(ctx, "example", &relay.NamespaceArgs{
 * 			Name:              pulumi.String("example-relay"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleHybridConnection, err := relay.NewHybridConnection(ctx, "example", &relay.HybridConnectionArgs{
 * 			Name:               pulumi.String("examplerhc1"),
 * 			ResourceGroupName:  example.Name,
 * 			RelayNamespaceName: exampleNamespace.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("storageaccountname"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("GRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleWindowsWebApp, err := appservice.NewWindowsWebApp(ctx, "example", &appservice.WindowsWebAppArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ServicePlanId:     exampleServicePlan.ID(),
 * 			SiteConfig:        nil,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appservice.NewWindowsFunctionApp(ctx, "example", &appservice.WindowsFunctionAppArgs{
 * 			Name:                    pulumi.String("example-function-app"),
 * 			Location:                example.Location,
 * 			ResourceGroupName:       example.Name,
 * 			ServicePlanId:           exampleServicePlan.ID(),
 * 			StorageAccountName:      exampleAccount.Name,
 * 			StorageAccountAccessKey: exampleAccount.PrimaryAccessKey,
 * 			SiteConfig:              nil,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appservice.NewFunctionAppHybridConnection(ctx, "example", &appservice.FunctionAppHybridConnectionArgs{
 * 			FunctionAppId: exampleWindowsWebApp.ID(),
 * 			RelayId:       exampleHybridConnection.ID(),
 * 			Hostname:      pulumi.String("myhostname.example"),
 * 			Port:          pulumi.Int(8081),
 * 		})
 * 		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.appservice.ServicePlan;
 * import com.pulumi.azure.appservice.ServicePlanArgs;
 * import com.pulumi.azure.relay.Namespace;
 * import com.pulumi.azure.relay.NamespaceArgs;
 * import com.pulumi.azure.relay.HybridConnection;
 * import com.pulumi.azure.relay.HybridConnectionArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.appservice.WindowsWebApp;
 * import com.pulumi.azure.appservice.WindowsWebAppArgs;
 * import com.pulumi.azure.appservice.inputs.WindowsWebAppSiteConfigArgs;
 * import com.pulumi.azure.appservice.WindowsFunctionApp;
 * import com.pulumi.azure.appservice.WindowsFunctionAppArgs;
 * import com.pulumi.azure.appservice.inputs.WindowsFunctionAppSiteConfigArgs;
 * import com.pulumi.azure.appservice.FunctionAppHybridConnection;
 * import com.pulumi.azure.appservice.FunctionAppHybridConnectionArgs;
 * 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-rg")
 *             .location("West Europe")
 *             .build());
 *         var exampleServicePlan = new ServicePlan("exampleServicePlan", ServicePlanArgs.builder()
 *             .name("example-plan")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .osType("Windows")
 *             .skuName("S1")
 *             .build());
 *         var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
 *             .name("example-relay")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("Standard")
 *             .build());
 *         var exampleHybridConnection = new HybridConnection("exampleHybridConnection", HybridConnectionArgs.builder()
 *             .name("examplerhc1")
 *             .resourceGroupName(example.name())
 *             .relayNamespaceName(exampleNamespace.name())
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("storageaccountname")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *         var exampleWindowsWebApp = new WindowsWebApp("exampleWindowsWebApp", WindowsWebAppArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .servicePlanId(exampleServicePlan.id())
 *             .siteConfig()
 *             .build());
 *         var exampleWindowsFunctionApp = new WindowsFunctionApp("exampleWindowsFunctionApp", WindowsFunctionAppArgs.builder()
 *             .name("example-function-app")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .servicePlanId(exampleServicePlan.id())
 *             .storageAccountName(exampleAccount.name())
 *             .storageAccountAccessKey(exampleAccount.primaryAccessKey())
 *             .siteConfig()
 *             .build());
 *         var exampleFunctionAppHybridConnection = new FunctionAppHybridConnection("exampleFunctionAppHybridConnection", FunctionAppHybridConnectionArgs.builder()
 *             .functionAppId(exampleWindowsWebApp.id())
 *             .relayId(exampleHybridConnection.id())
 *             .hostname("myhostname.example")
 *             .port(8081)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg
 *       location: West Europe
 *   exampleServicePlan:
 *     type: azure:appservice:ServicePlan
 *     name: example
 *     properties:
 *       name: example-plan
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       osType: Windows
 *       skuName: S1
 *   exampleNamespace:
 *     type: azure:relay:Namespace
 *     name: example
 *     properties:
 *       name: example-relay
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: Standard
 *   exampleHybridConnection:
 *     type: azure:relay:HybridConnection
 *     name: example
 *     properties:
 *       name: examplerhc1
 *       resourceGroupName: ${example.name}
 *       relayNamespaceName: ${exampleNamespace.name}
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: storageaccountname
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 *   exampleWindowsWebApp:
 *     type: azure:appservice:WindowsWebApp
 *     name: example
 *     properties:
 *       name: example
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       servicePlanId: ${exampleServicePlan.id}
 *       siteConfig: {}
 *   exampleWindowsFunctionApp:
 *     type: azure:appservice:WindowsFunctionApp
 *     name: example
 *     properties:
 *       name: example-function-app
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       servicePlanId: ${exampleServicePlan.id}
 *       storageAccountName: ${exampleAccount.name}
 *       storageAccountAccessKey: ${exampleAccount.primaryAccessKey}
 *       siteConfig: {}
 *   exampleFunctionAppHybridConnection:
 *     type: azure:appservice:FunctionAppHybridConnection
 *     name: example
 *     properties:
 *       functionAppId: ${exampleWindowsWebApp.id}
 *       relayId: ${exampleHybridConnection.id}
 *       hostname: myhostname.example
 *       port: 8081
 * ```
 * 
 * ## Import
 * a Function App Hybrid Connection can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appservice/functionAppHybridConnection:FunctionAppHybridConnection example "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/hybridConnectionNamespaces/hybridConnectionNamespace1/relays/relay1"
 * ```
 */
public class FunctionAppHybridConnection internal constructor(
    override val javaResource: com.pulumi.azure.appservice.FunctionAppHybridConnection,
) : KotlinCustomResource(javaResource, FunctionAppHybridConnectionMapper) {
    /**
     * The ID of the Function App for this Hybrid Connection. Changing this forces a new resource to be created.
     */
    public val functionAppId: Output
        get() = javaResource.functionAppId().applyValue({ args0 -> args0 })

    /**
     * The hostname of the endpoint.
     */
    public val hostname: Output
        get() = javaResource.hostname().applyValue({ args0 -> args0 })

    /**
     * The name of the Relay Namespace.
     */
    public val namespaceName: Output
        get() = javaResource.namespaceName().applyValue({ args0 -> args0 })

    /**
     * The port to use for the endpoint
     */
    public val port: Output
        get() = javaResource.port().applyValue({ args0 -> args0 })

    /**
     * The ID of the Relay Hybrid Connection to use. Changing this forces a new resource to be created.
     */
    public val relayId: Output
        get() = javaResource.relayId().applyValue({ args0 -> args0 })

    /**
     * The name of the Relay in use.
     */
    public val relayName: Output
        get() = javaResource.relayName().applyValue({ args0 -> args0 })

    /**
     * The name of the Relay key with `Send` permission to use. Defaults to `RootManageSharedAccessKey`
     */
    public val sendKeyName: Output?
        get() = javaResource.sendKeyName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Primary Access Key for the `send_key_name`
     */
    public val sendKeyValue: Output
        get() = javaResource.sendKeyValue().applyValue({ args0 -> args0 })

    /**
     * The Service Bus Namespace.
     */
    public val serviceBusNamespace: Output
        get() = javaResource.serviceBusNamespace().applyValue({ args0 -> args0 })

    /**
     * The suffix for the endpoint.
     */
    public val serviceBusSuffix: Output
        get() = javaResource.serviceBusSuffix().applyValue({ args0 -> args0 })
}

public object FunctionAppHybridConnectionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.appservice.FunctionAppHybridConnection::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy