1. Packages
  2. Azure Classic
  3. API Docs
  4. webpubsub
  5. Hub

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.webpubsub.Hub

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Manages the hub settings for a Web Pubsub.

    Example Usage

    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],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="terraform-webpubsub",
        location="east us")
    example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
        name="tfex-uai",
        resource_group_name=example.name,
        location=example.location)
    example_service = azure.webpubsub.Service("example",
        name="tfex-webpubsub",
        location=example.location,
        resource_group_name=example.name,
        sku="Standard_S1",
        capacity=1)
    example_hub = azure.webpubsub.Hub("example",
        name="tfex_wpsh",
        web_pubsub_id=example_service.id,
        event_handlers=[
            azure.webpubsub.HubEventHandlerArgs(
                url_template="https://test.com/api/{hub}/{event}",
                user_event_pattern="*",
                system_events=[
                    "connect",
                    "connected",
                ],
            ),
            azure.webpubsub.HubEventHandlerArgs(
                url_template="https://test.com/api/{hub}/{event}",
                user_event_pattern="event1, event2",
                system_events=["connected"],
                auth=azure.webpubsub.HubEventHandlerAuthArgs(
                    managed_identity_id=example_user_assigned_identity.id,
                ),
            ),
        ],
        event_listeners=[
            azure.webpubsub.HubEventListenerArgs(
                system_event_name_filters=["connected"],
                user_event_name_filters=[
                    "event1",
                    "event2",
                ],
                eventhub_namespace_name=test["name"],
                eventhub_name=test1["name"],
            ),
            azure.webpubsub.HubEventListenerArgs(
                system_event_name_filters=["connected"],
                user_event_name_filters=["*"],
                eventhub_namespace_name=test["name"],
                eventhub_name=test1["name"],
            ),
            azure.webpubsub.HubEventListenerArgs(
                system_event_name_filters=["connected"],
                user_event_name_filters=["event1"],
                eventhub_namespace_name=test["name"],
                eventhub_name=test1["name"],
            ),
        ],
        anonymous_connections_enabled=True,
        opts=pulumi.ResourceOptions(depends_on=[example_service]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub"
    	"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("terraform-webpubsub"),
    			Location: pulumi.String("east us"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
    			Name:              pulumi.String("tfex-uai"),
    			ResourceGroupName: example.Name,
    			Location:          example.Location,
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := webpubsub.NewService(ctx, "example", &webpubsub.ServiceArgs{
    			Name:              pulumi.String("tfex-webpubsub"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Sku:               pulumi.String("Standard_S1"),
    			Capacity:          pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = webpubsub.NewHub(ctx, "example", &webpubsub.HubArgs{
    			Name:        pulumi.String("tfex_wpsh"),
    			WebPubsubId: exampleService.ID(),
    			EventHandlers: webpubsub.HubEventHandlerArray{
    				&webpubsub.HubEventHandlerArgs{
    					UrlTemplate:      pulumi.String("https://test.com/api/{hub}/{event}"),
    					UserEventPattern: pulumi.String("*"),
    					SystemEvents: pulumi.StringArray{
    						pulumi.String("connect"),
    						pulumi.String("connected"),
    					},
    				},
    				&webpubsub.HubEventHandlerArgs{
    					UrlTemplate:      pulumi.String("https://test.com/api/{hub}/{event}"),
    					UserEventPattern: pulumi.String("event1, event2"),
    					SystemEvents: pulumi.StringArray{
    						pulumi.String("connected"),
    					},
    					Auth: &webpubsub.HubEventHandlerAuthArgs{
    						ManagedIdentityId: exampleUserAssignedIdentity.ID(),
    					},
    				},
    			},
    			EventListeners: webpubsub.HubEventListenerArray{
    				&webpubsub.HubEventListenerArgs{
    					SystemEventNameFilters: pulumi.StringArray{
    						pulumi.String("connected"),
    					},
    					UserEventNameFilters: pulumi.StringArray{
    						pulumi.String("event1"),
    						pulumi.String("event2"),
    					},
    					EventhubNamespaceName: pulumi.Any(test.Name),
    					EventhubName:          pulumi.Any(test1.Name),
    				},
    				&webpubsub.HubEventListenerArgs{
    					SystemEventNameFilters: pulumi.StringArray{
    						pulumi.String("connected"),
    					},
    					UserEventNameFilters: pulumi.StringArray{
    						pulumi.String("*"),
    					},
    					EventhubNamespaceName: pulumi.Any(test.Name),
    					EventhubName:          pulumi.Any(test1.Name),
    				},
    				&webpubsub.HubEventListenerArgs{
    					SystemEventNameFilters: pulumi.StringArray{
    						pulumi.String("connected"),
    					},
    					UserEventNameFilters: pulumi.StringArray{
    						pulumi.String("event1"),
    					},
    					EventhubNamespaceName: pulumi.Any(test.Name),
    					EventhubName:          pulumi.Any(test1.Name),
    				},
    			},
    			AnonymousConnectionsEnabled: pulumi.Bool(true),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			exampleService,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = "terraform-webpubsub",
            Location = "east us",
        });
    
        var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
        {
            Name = "tfex-uai",
            ResourceGroupName = example.Name,
            Location = example.Location,
        });
    
        var exampleService = new Azure.WebPubSub.Service("example", new()
        {
            Name = "tfex-webpubsub",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Sku = "Standard_S1",
            Capacity = 1,
        });
    
        var exampleHub = new Azure.WebPubSub.Hub("example", new()
        {
            Name = "tfex_wpsh",
            WebPubsubId = exampleService.Id,
            EventHandlers = new[]
            {
                new Azure.WebPubSub.Inputs.HubEventHandlerArgs
                {
                    UrlTemplate = "https://test.com/api/{hub}/{event}",
                    UserEventPattern = "*",
                    SystemEvents = new[]
                    {
                        "connect",
                        "connected",
                    },
                },
                new Azure.WebPubSub.Inputs.HubEventHandlerArgs
                {
                    UrlTemplate = "https://test.com/api/{hub}/{event}",
                    UserEventPattern = "event1, event2",
                    SystemEvents = new[]
                    {
                        "connected",
                    },
                    Auth = new Azure.WebPubSub.Inputs.HubEventHandlerAuthArgs
                    {
                        ManagedIdentityId = exampleUserAssignedIdentity.Id,
                    },
                },
            },
            EventListeners = new[]
            {
                new Azure.WebPubSub.Inputs.HubEventListenerArgs
                {
                    SystemEventNameFilters = new[]
                    {
                        "connected",
                    },
                    UserEventNameFilters = new[]
                    {
                        "event1",
                        "event2",
                    },
                    EventhubNamespaceName = test.Name,
                    EventhubName = test1.Name,
                },
                new Azure.WebPubSub.Inputs.HubEventListenerArgs
                {
                    SystemEventNameFilters = new[]
                    {
                        "connected",
                    },
                    UserEventNameFilters = new[]
                    {
                        "*",
                    },
                    EventhubNamespaceName = test.Name,
                    EventhubName = test1.Name,
                },
                new Azure.WebPubSub.Inputs.HubEventListenerArgs
                {
                    SystemEventNameFilters = new[]
                    {
                        "connected",
                    },
                    UserEventNameFilters = new[]
                    {
                        "event1",
                    },
                    EventhubNamespaceName = test.Name,
                    EventhubName = test1.Name,
                },
            },
            AnonymousConnectionsEnabled = true,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                exampleService,
            },
        });
    
    });
    
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("terraform-webpubsub")
                .location("east us")
                .build());
    
            var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
                .name("tfex-uai")
                .resourceGroupName(example.name())
                .location(example.location())
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("tfex-webpubsub")
                .location(example.location())
                .resourceGroupName(example.name())
                .sku("Standard_S1")
                .capacity(1)
                .build());
    
            var exampleHub = new Hub("exampleHub", HubArgs.builder()
                .name("tfex_wpsh")
                .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(test.name())
                        .eventhubName(test1.name())
                        .build(),
                    HubEventListenerArgs.builder()
                        .systemEventNameFilters("connected")
                        .userEventNameFilters("*")
                        .eventhubNamespaceName(test.name())
                        .eventhubName(test1.name())
                        .build(),
                    HubEventListenerArgs.builder()
                        .systemEventNameFilters("connected")
                        .userEventNameFilters("event1")
                        .eventhubNamespaceName(test.name())
                        .eventhubName(test1.name())
                        .build())
                .anonymousConnectionsEnabled(true)
                .build(), CustomResourceOptions.builder()
                    .dependsOn(exampleService)
                    .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: terraform-webpubsub
          location: east us
      exampleUserAssignedIdentity:
        type: azure:authorization:UserAssignedIdentity
        name: example
        properties:
          name: tfex-uai
          resourceGroupName: ${example.name}
          location: ${example.location}
      exampleService:
        type: azure:webpubsub:Service
        name: example
        properties:
          name: tfex-webpubsub
          location: ${example.location}
          resourceGroupName: ${example.name}
          sku: Standard_S1
          capacity: 1
      exampleHub:
        type: azure:webpubsub:Hub
        name: example
        properties:
          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
        options:
          dependson:
            - ${exampleService}
    

    Create Hub Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Hub(name: string, args: HubArgs, opts?: CustomResourceOptions);
    @overload
    def Hub(resource_name: str,
            args: HubArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Hub(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            web_pubsub_id: Optional[str] = None,
            anonymous_connections_enabled: Optional[bool] = None,
            event_handlers: Optional[Sequence[HubEventHandlerArgs]] = None,
            event_listeners: Optional[Sequence[HubEventListenerArgs]] = None,
            name: Optional[str] = None)
    func NewHub(ctx *Context, name string, args HubArgs, opts ...ResourceOption) (*Hub, error)
    public Hub(string name, HubArgs args, CustomResourceOptions? opts = null)
    public Hub(String name, HubArgs args)
    public Hub(String name, HubArgs args, CustomResourceOptions options)
    
    type: azure:webpubsub:Hub
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args HubArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args HubArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args HubArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HubArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HubArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var azureHubResource = new Azure.WebPubSub.Hub("azureHubResource", new()
    {
        WebPubsubId = "string",
        AnonymousConnectionsEnabled = false,
        EventHandlers = new[]
        {
            new Azure.WebPubSub.Inputs.HubEventHandlerArgs
            {
                UrlTemplate = "string",
                Auth = new Azure.WebPubSub.Inputs.HubEventHandlerAuthArgs
                {
                    ManagedIdentityId = "string",
                },
                SystemEvents = new[]
                {
                    "string",
                },
                UserEventPattern = "string",
            },
        },
        EventListeners = new[]
        {
            new Azure.WebPubSub.Inputs.HubEventListenerArgs
            {
                EventhubName = "string",
                EventhubNamespaceName = "string",
                SystemEventNameFilters = new[]
                {
                    "string",
                },
                UserEventNameFilters = new[]
                {
                    "string",
                },
            },
        },
        Name = "string",
    });
    
    example, err := webpubsub.NewHub(ctx, "azureHubResource", &webpubsub.HubArgs{
    	WebPubsubId:                 pulumi.String("string"),
    	AnonymousConnectionsEnabled: pulumi.Bool(false),
    	EventHandlers: webpubsub.HubEventHandlerArray{
    		&webpubsub.HubEventHandlerArgs{
    			UrlTemplate: pulumi.String("string"),
    			Auth: &webpubsub.HubEventHandlerAuthArgs{
    				ManagedIdentityId: pulumi.String("string"),
    			},
    			SystemEvents: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			UserEventPattern: pulumi.String("string"),
    		},
    	},
    	EventListeners: webpubsub.HubEventListenerArray{
    		&webpubsub.HubEventListenerArgs{
    			EventhubName:          pulumi.String("string"),
    			EventhubNamespaceName: pulumi.String("string"),
    			SystemEventNameFilters: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			UserEventNameFilters: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var azureHubResource = new Hub("azureHubResource", HubArgs.builder()
        .webPubsubId("string")
        .anonymousConnectionsEnabled(false)
        .eventHandlers(HubEventHandlerArgs.builder()
            .urlTemplate("string")
            .auth(HubEventHandlerAuthArgs.builder()
                .managedIdentityId("string")
                .build())
            .systemEvents("string")
            .userEventPattern("string")
            .build())
        .eventListeners(HubEventListenerArgs.builder()
            .eventhubName("string")
            .eventhubNamespaceName("string")
            .systemEventNameFilters("string")
            .userEventNameFilters("string")
            .build())
        .name("string")
        .build());
    
    azure_hub_resource = azure.webpubsub.Hub("azureHubResource",
        web_pubsub_id="string",
        anonymous_connections_enabled=False,
        event_handlers=[azure.webpubsub.HubEventHandlerArgs(
            url_template="string",
            auth=azure.webpubsub.HubEventHandlerAuthArgs(
                managed_identity_id="string",
            ),
            system_events=["string"],
            user_event_pattern="string",
        )],
        event_listeners=[azure.webpubsub.HubEventListenerArgs(
            eventhub_name="string",
            eventhub_namespace_name="string",
            system_event_name_filters=["string"],
            user_event_name_filters=["string"],
        )],
        name="string")
    
    const azureHubResource = new azure.webpubsub.Hub("azureHubResource", {
        webPubsubId: "string",
        anonymousConnectionsEnabled: false,
        eventHandlers: [{
            urlTemplate: "string",
            auth: {
                managedIdentityId: "string",
            },
            systemEvents: ["string"],
            userEventPattern: "string",
        }],
        eventListeners: [{
            eventhubName: "string",
            eventhubNamespaceName: "string",
            systemEventNameFilters: ["string"],
            userEventNameFilters: ["string"],
        }],
        name: "string",
    });
    
    type: azure:webpubsub:Hub
    properties:
        anonymousConnectionsEnabled: false
        eventHandlers:
            - auth:
                managedIdentityId: string
              systemEvents:
                - string
              urlTemplate: string
              userEventPattern: string
        eventListeners:
            - eventhubName: string
              eventhubNamespaceName: string
              systemEventNameFilters:
                - string
              userEventNameFilters:
                - string
        name: string
        webPubsubId: string
    

    Hub Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Hub resource accepts the following input properties:

    WebPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    AnonymousConnectionsEnabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    EventHandlers List<HubEventHandler>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    EventListeners List<HubEventListener>

    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.

    Name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    WebPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    AnonymousConnectionsEnabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    EventHandlers []HubEventHandlerArgs

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    EventListeners []HubEventListenerArgs

    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.

    Name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId String
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled Boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers List<HubEventHandler>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners List<HubEventListener>

    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.

    name String
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers HubEventHandler[]

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners HubEventListener[]

    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.

    name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    web_pubsub_id str
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymous_connections_enabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    event_handlers Sequence[HubEventHandlerArgs]

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    event_listeners Sequence[HubEventListenerArgs]

    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.

    name str
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId String
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled Boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers List<Property Map>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners List<Property Map>

    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.

    name String
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Hub resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Hub Resource

    Get an existing Hub resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: HubState, opts?: CustomResourceOptions): Hub
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            anonymous_connections_enabled: Optional[bool] = None,
            event_handlers: Optional[Sequence[HubEventHandlerArgs]] = None,
            event_listeners: Optional[Sequence[HubEventListenerArgs]] = None,
            name: Optional[str] = None,
            web_pubsub_id: Optional[str] = None) -> Hub
    func GetHub(ctx *Context, name string, id IDInput, state *HubState, opts ...ResourceOption) (*Hub, error)
    public static Hub Get(string name, Input<string> id, HubState? state, CustomResourceOptions? opts = null)
    public static Hub get(String name, Output<String> id, HubState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AnonymousConnectionsEnabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    EventHandlers List<HubEventHandler>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    EventListeners List<HubEventListener>

    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.

    Name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    WebPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    AnonymousConnectionsEnabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    EventHandlers []HubEventHandlerArgs

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    EventListeners []HubEventListenerArgs

    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.

    Name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    WebPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled Boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers List<HubEventHandler>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners List<HubEventListener>

    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.

    name String
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId String
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers HubEventHandler[]

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners HubEventListener[]

    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.

    name string
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId string
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymous_connections_enabled bool
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    event_handlers Sequence[HubEventHandlerArgs]

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    event_listeners Sequence[HubEventListenerArgs]

    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.

    name str
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    web_pubsub_id str
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
    anonymousConnectionsEnabled Boolean
    Is anonymous connections are allowed for this hub? Defaults to false. Possible values are true, false.
    eventHandlers List<Property Map>

    An event_handler block as defined below.

    NOTE: User can change the order of event_handler to change the priority accordingly.

    eventListeners List<Property Map>

    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.

    name String
    The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
    webPubsubId String
    Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.

    Supporting Types

    HubEventHandler, HubEventHandlerArgs

    UrlTemplate string
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    Auth HubEventHandlerAuth
    An auth block as defined below.
    SystemEvents List<string>
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    UserEventPattern string
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.
    UrlTemplate string
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    Auth HubEventHandlerAuth
    An auth block as defined below.
    SystemEvents []string
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    UserEventPattern string
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.
    urlTemplate String
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    auth HubEventHandlerAuth
    An auth block as defined below.
    systemEvents List<String>
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    userEventPattern String
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.
    urlTemplate string
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    auth HubEventHandlerAuth
    An auth block as defined below.
    systemEvents string[]
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    userEventPattern string
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.
    url_template str
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    auth HubEventHandlerAuth
    An auth block as defined below.
    system_events Sequence[str]
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    user_event_pattern str
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.
    urlTemplate String
    The Event Handler URL Template. Two predefined parameters {hub} and {event} are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: http://example.com/api/{hub}/{event}.
    auth Property Map
    An auth block as defined below.
    systemEvents List<String>
    Specifies the list of system events. Supported values are connect, connected and disconnected.
    userEventPattern String
    Specifies the matching event names. There are 3 kind of patterns supported: * * matches any event name * , Combine multiple events with , for example event1,event2, it matches event event1 and event2 * The single event name, for example event1, it matches event1.

    HubEventHandlerAuth, HubEventHandlerAuthArgs

    ManagedIdentityId string

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    ManagedIdentityId string

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    managedIdentityId String

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    managedIdentityId string

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    managed_identity_id str

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    managedIdentityId String

    Specify the identity ID of the target resource.

    NOTE: managed_identity_id is required if the auth block is defined

    HubEventListener, HubEventListenerArgs

    EventhubName string
    Specifies the event hub name to receive the events.
    EventhubNamespaceName string
    Specifies the event hub namespace name to receive the events.
    SystemEventNameFilters List<string>
    Specifies the list of system events. Supported values are connected and disconnected.
    UserEventNameFilters List<string>
    Specifies the list of matching user event names. ["*"] can be used to match all events.
    EventhubName string
    Specifies the event hub name to receive the events.
    EventhubNamespaceName string
    Specifies the event hub namespace name to receive the events.
    SystemEventNameFilters []string
    Specifies the list of system events. Supported values are connected and disconnected.
    UserEventNameFilters []string
    Specifies the list of matching user event names. ["*"] can be used to match all events.
    eventhubName String
    Specifies the event hub name to receive the events.
    eventhubNamespaceName String
    Specifies the event hub namespace name to receive the events.
    systemEventNameFilters List<String>
    Specifies the list of system events. Supported values are connected and disconnected.
    userEventNameFilters List<String>
    Specifies the list of matching user event names. ["*"] can be used to match all events.
    eventhubName string
    Specifies the event hub name to receive the events.
    eventhubNamespaceName string
    Specifies the event hub namespace name to receive the events.
    systemEventNameFilters string[]
    Specifies the list of system events. Supported values are connected and disconnected.
    userEventNameFilters string[]
    Specifies the list of matching user event names. ["*"] can be used to match all events.
    eventhub_name str
    Specifies the event hub name to receive the events.
    eventhub_namespace_name str
    Specifies the event hub namespace name to receive the events.
    system_event_name_filters Sequence[str]
    Specifies the list of system events. Supported values are connected and disconnected.
    user_event_name_filters Sequence[str]
    Specifies the list of matching user event names. ["*"] can be used to match all events.
    eventhubName String
    Specifies the event hub name to receive the events.
    eventhubNamespaceName String
    Specifies the event hub namespace name to receive the events.
    systemEventNameFilters List<String>
    Specifies the list of system events. Supported values are connected and disconnected.
    userEventNameFilters List<String>
    Specifies the list of matching user event names. ["*"] can be used to match all events.

    Import

    Web Pubsub Hub can be imported using the resource id, e.g.

    $ pulumi import azure:webpubsub/hub:Hub example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/webPubSub1/hubs/webPubSubhub1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi