GetEventHub

Use this data source to access information about an existing EventHub.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.EventHub.GetEventHub.InvokeAsync(new Azure.EventHub.GetEventHubArgs
        {
            Name = "search-eventhub",
            ResourceGroupName = "search-service",
            NamespaceName = "search-eventhubns",
        }));
        this.EventhubId = example.Apply(example => example.Id);
    }

    [Output("eventhubId")]
    public Output<string> EventhubId { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/eventhub"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := eventhub.LookupEventHub(ctx, &eventhub.LookupEventHubArgs{
            Name:              "search-eventhub",
            ResourceGroupName: "search-service",
            NamespaceName:     "search-eventhubns",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("eventhubId", example.Id)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.eventhub.get_event_hub(name="search-eventhub",
    resource_group_name="search-service",
    namespace_name="search-eventhubns")
pulumi.export("eventhubId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.eventhub.getEventHub({
    name: "search-eventhub",
    resourceGroupName: "search-service",
    namespaceName: "search-eventhubns",
});
export const eventhubId = example.then(example => example.id);

Using GetEventHub

function getEventHub(args: GetEventHubArgs, opts?: InvokeOptions): Promise<GetEventHubResult>
function  get_event_hub(name=None, namespace_name=None, resource_group_name=None, opts=None)
func LookupEventHub(ctx *Context, args *LookupEventHubArgs, opts ...InvokeOption) (*LookupEventHubResult, error)

Note: This function is named LookupEventHub in the Go SDK.

public static class GetEventHub {
    public static Task<GetEventHubResult> InvokeAsync(GetEventHubArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of this EventHub.

NamespaceName string

The name of the EventHub Namespace where the EventHub exists.

ResourceGroupName string

The name of the Resource Group where the EventHub exists.

Name string

The name of this EventHub.

NamespaceName string

The name of the EventHub Namespace where the EventHub exists.

ResourceGroupName string

The name of the Resource Group where the EventHub exists.

name string

The name of this EventHub.

namespaceName string

The name of the EventHub Namespace where the EventHub exists.

resourceGroupName string

The name of the Resource Group where the EventHub exists.

name str

The name of this EventHub.

namespace_name str

The name of the EventHub Namespace where the EventHub exists.

resource_group_name str

The name of the Resource Group where the EventHub exists.

GetEventHub Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Name string
NamespaceName string
PartitionCount int

The number of partitions in the EventHub.

PartitionIds List<string>

The identifiers for the partitions of this EventHub.

ResourceGroupName string
Id string

The provider-assigned unique ID for this managed resource.

Name string
NamespaceName string
PartitionCount int

The number of partitions in the EventHub.

PartitionIds []string

The identifiers for the partitions of this EventHub.

ResourceGroupName string
id string

The provider-assigned unique ID for this managed resource.

name string
namespaceName string
partitionCount number

The number of partitions in the EventHub.

partitionIds string[]

The identifiers for the partitions of this EventHub.

resourceGroupName string
id str

The provider-assigned unique ID for this managed resource.

name str
namespace_name str
partition_count float

The number of partitions in the EventHub.

partition_ids List[str]

The identifiers for the partitions of this EventHub.

resource_group_name str

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.