import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages the hub settings for a Web Pubsub. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "terraform-webpubsub", * location: "east us", * }); * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", { * name: "tfex-uai", * resourceGroupName: example.name, * location: example.location, * }); * const exampleService = new azure.webpubsub.Service("example", { * name: "tfex-webpubsub", * location: example.location, * resourceGroupName: example.name, * sku: "Standard_S1", * capacity: 1, * }); * const exampleHub = new azure.webpubsub.Hub("example", { * name: "tfex_wpsh", * webPubsubId: exampleService.id, * eventHandlers: [ * { * urlTemplate: "https://test.com/api/{hub}/{event}", * userEventPattern: "*", * systemEvents: [ * "connect", * "connected", * ], * }, * { * urlTemplate: "https://test.com/api/{hub}/{event}", * userEventPattern: "event1, event2", * systemEvents: ["connected"], * auth: { * managedIdentityId: exampleUserAssignedIdentity.id, * }, * }, * ], * eventListeners: [ * { * systemEventNameFilters: ["connected"], * userEventNameFilters: [ * "event1", * "event2", * ], * eventhubNamespaceName: test.name, * eventhubName: test1.name, * }, * { * systemEventNameFilters: ["connected"], * userEventNameFilters: ["*"], * eventhubNamespaceName: test.name, * eventhubName: test1.name, * }, * { * systemEventNameFilters: ["connected"], * userEventNameFilters: ["event1"], * eventhubNamespaceName: test.name, * eventhubName: test1.name, * }, * ], * anonymousConnectionsEnabled: true, * }, { * dependsOn: [exampleService], * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.SignalRService` - 2024-03-01 * * ## 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 * ``` */ export declare class Hub extends pulumi.CustomResource { /** * Get an existing Hub resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: HubState, opts?: pulumi.CustomResourceOptions): Hub; /** * Returns true if the given object is an instance of Hub. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Hub; /** * Is anonymous connections are allowed for this hub? Defaults to `false`. * Possible values are `true`, `false`. */ readonly anonymousConnectionsEnabled: pulumi.Output; /** * An `eventHandler` block as defined below. * * > **Note:** User can change the order of `eventHandler` to change the priority accordingly. */ readonly eventHandlers: pulumi.Output; /** * An `eventListener` 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. */ readonly eventListeners: pulumi.Output; /** * The name of the Web Pubsub hub service. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * Specifies the id of the Web Pubsub. Changing this forces a new resource to be created. */ readonly webPubsubId: pulumi.Output; /** * Create a Hub resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HubArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Hub resources. */ export interface HubState { /** * Is anonymous connections are allowed for this hub? Defaults to `false`. * Possible values are `true`, `false`. */ anonymousConnectionsEnabled?: pulumi.Input; /** * An `eventHandler` block as defined below. * * > **Note:** User can change the order of `eventHandler` to change the priority accordingly. */ eventHandlers?: pulumi.Input[]>; /** * An `eventListener` 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. */ eventListeners?: pulumi.Input[]>; /** * The name of the Web Pubsub hub service. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Specifies the id of the Web Pubsub. Changing this forces a new resource to be created. */ webPubsubId?: pulumi.Input; } /** * The set of arguments for constructing a Hub resource. */ export interface HubArgs { /** * Is anonymous connections are allowed for this hub? Defaults to `false`. * Possible values are `true`, `false`. */ anonymousConnectionsEnabled?: pulumi.Input; /** * An `eventHandler` block as defined below. * * > **Note:** User can change the order of `eventHandler` to change the priority accordingly. */ eventHandlers?: pulumi.Input[]>; /** * An `eventListener` 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. */ eventListeners?: pulumi.Input[]>; /** * The name of the Web Pubsub hub service. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Specifies the id of the Web Pubsub. Changing this forces a new resource to be created. */ webPubsubId: pulumi.Input; }