Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.webpubsub.kotlin
import com.pulumi.azure.webpubsub.HubArgs.builder
import com.pulumi.azure.webpubsub.kotlin.inputs.HubEventHandlerArgs
import com.pulumi.azure.webpubsub.kotlin.inputs.HubEventHandlerArgsBuilder
import com.pulumi.azure.webpubsub.kotlin.inputs.HubEventListenerArgs
import com.pulumi.azure.webpubsub.kotlin.inputs.HubEventListenerArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages the hub settings for a Web Pubsub.
* ## Example Usage
* ```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.authorization.UserAssignedIdentity;
* import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
* import com.pulumi.azure.webpubsub.Service;
* import com.pulumi.azure.webpubsub.ServiceArgs;
* import com.pulumi.azure.webpubsub.Hub;
* import com.pulumi.azure.webpubsub.HubArgs;
* import com.pulumi.azure.webpubsub.inputs.HubEventHandlerArgs;
* import com.pulumi.azure.webpubsub.inputs.HubEventHandlerAuthArgs;
* import com.pulumi.azure.webpubsub.inputs.HubEventListenerArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .location("east us")
* .build());
* var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .build());
* var exampleService = new Service("exampleService", ServiceArgs.builder()
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .sku("Standard_S1")
* .capacity(1)
* .build());
* var exampleHub = new Hub("exampleHub", HubArgs.builder()
* .webPubsubId(exampleService.id())
* .eventHandlers(
* HubEventHandlerArgs.builder()
* .urlTemplate("https://test.com/api/{hub}/{event}")
* .userEventPattern("*")
* .systemEvents(
* "connect",
* "connected")
* .build(),
* HubEventHandlerArgs.builder()
* .urlTemplate("https://test.com/api/{hub}/{event}")
* .userEventPattern("event1, event2")
* .systemEvents("connected")
* .auth(HubEventHandlerAuthArgs.builder()
* .managedIdentityId(exampleUserAssignedIdentity.id())
* .build())
* .build())
* .eventListeners(
* HubEventListenerArgs.builder()
* .systemEventNameFilters("connected")
* .userEventNameFilters(
* "event1",
* "event2")
* .eventhubNamespaceName(azurerm_eventhub_namespace.test().name())
* .eventhubName(azurerm_eventhub.test1().name())
* .build(),
* HubEventListenerArgs.builder()
* .systemEventNameFilters("connected")
* .userEventNameFilters("*")
* .eventhubNamespaceName(azurerm_eventhub_namespace.test().name())
* .eventhubName(azurerm_eventhub.test1().name())
* .build(),
* HubEventListenerArgs.builder()
* .systemEventNameFilters("connected")
* .userEventNameFilters("event1")
* .eventhubNamespaceName(azurerm_eventhub_namespace.test().name())
* .eventhubName(azurerm_eventhub.test1().name())
* .build())
* .anonymousConnectionsEnabled(true)
* .build(), CustomResourceOptions.builder()
* .dependsOn(exampleService)
* .build());
* }
* }
* ```
* ## Import
* Web Pubsub Hub can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:webpubsub/hub:Hub example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/webPubSub1/hubs/webPubSubhub1
* ```
* @property anonymousConnectionsEnabled Is anonymous connections are allowed for this hub? Defaults to `false`.
* Possible values are `true`, `false`.
* @property eventHandlers An `event_handler` block as defined below.
* > **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
* @property eventListeners An `event_listener` block as defined below.
* > **NOTE:** The managed identity of Web PubSub service must be enabled and the identity must have the "Azure Event Hubs Data sender" role to access the Event Hub.
* @property name The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
* @property webPubsubId Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
*/
public data class HubArgs(
public val anonymousConnectionsEnabled: Output? = null,
public val eventHandlers: Output>? = null,
public val eventListeners: Output>? = null,
public val name: Output? = null,
public val webPubsubId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.webpubsub.HubArgs =
com.pulumi.azure.webpubsub.HubArgs.builder()
.anonymousConnectionsEnabled(anonymousConnectionsEnabled?.applyValue({ args0 -> args0 }))
.eventHandlers(
eventHandlers?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.eventListeners(
eventListeners?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.name(name?.applyValue({ args0 -> args0 }))
.webPubsubId(webPubsubId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [HubArgs].
*/
@PulumiTagMarker
public class HubArgsBuilder internal constructor() {
private var anonymousConnectionsEnabled: Output? = null
private var eventHandlers: Output>? = null
private var eventListeners: Output>? = null
private var name: Output? = null
private var webPubsubId: Output? = null
/**
* @param value Is anonymous connections are allowed for this hub? Defaults to `false`.
* Possible values are `true`, `false`.
*/
@JvmName("gwjujliadjqhtlbq")
public suspend fun anonymousConnectionsEnabled(`value`: Output) {
this.anonymousConnectionsEnabled = value
}
/**
* @param value An `event_handler` block as defined below.
* > **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
*/
@JvmName("jiietddjtvqrwbmi")
public suspend fun eventHandlers(`value`: Output>) {
this.eventHandlers = value
}
@JvmName("bvfotvwbkxyvsbpv")
public suspend fun eventHandlers(vararg values: Output) {
this.eventHandlers = Output.all(values.asList())
}
/**
* @param values An `event_handler` block as defined below.
* > **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
*/
@JvmName("nialahmveennlevt")
public suspend fun eventHandlers(values: List