We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
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/v4/go/azure/eventhub"
"github.com/pulumi/pulumi/sdk/v3/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
})
}
Example coming soon!
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);
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)
Example coming soon!
Using getEventHub
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEventHub(args: GetEventHubArgs, opts?: InvokeOptions): Promise<GetEventHubResult>
function getEventHubOutput(args: GetEventHubOutputArgs, opts?: InvokeOptions): Output<GetEventHubResult>def get_event_hub(name: Optional[str] = None,
namespace_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEventHubResult
def get_event_hub_output(name: Optional[pulumi.Input[str]] = None,
namespace_name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetEventHubResult]func LookupEventHub(ctx *Context, args *LookupEventHubArgs, opts ...InvokeOption) (*LookupEventHubResult, error)
func LookupEventHubOutput(ctx *Context, args *LookupEventHubOutputArgs, opts ...InvokeOption) LookupEventHubResultOutput> Note: This function is named LookupEventHub in the Go SDK.
public static class GetEventHub
{
public static Task<GetEventHubResult> InvokeAsync(GetEventHubArgs args, InvokeOptions? opts = null)
public static Output<GetEventHubResult> Invoke(GetEventHubInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetEventHubResult> getEventHub(GetEventHubArgs args, InvokeOptions options)
public static Output<GetEventHubResult> getEventHub(GetEventHubArgs args, InvokeOptions options)
fn::invoke:
function: azure:eventhub/getEventHub:getEventHub
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of this EventHub.
- Namespace
Name string - The name of the EventHub Namespace where the EventHub exists.
- Resource
Group stringName - The name of the Resource Group where the EventHub exists.
- Name string
- The name of this EventHub.
- Namespace
Name string - The name of the EventHub Namespace where the EventHub exists.
- Resource
Group stringName - The name of the Resource Group where the EventHub exists.
- name String
- The name of this EventHub.
- namespace
Name String - The name of the EventHub Namespace where the EventHub exists.
- resource
Group StringName - The name of the Resource Group where the EventHub exists.
- name string
- The name of this EventHub.
- namespace
Name string - The name of the EventHub Namespace where the EventHub exists.
- resource
Group stringName - 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_ strname - The name of the Resource Group where the EventHub exists.
- name String
- The name of this EventHub.
- namespace
Name String - The name of the EventHub Namespace where the EventHub exists.
- resource
Group StringName - 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
- Namespace
Name string - Partition
Count int - The number of partitions in the EventHub.
- Partition
Ids List<string> - The identifiers for the partitions of this EventHub.
- Resource
Group stringName
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Namespace
Name string - Partition
Count int - The number of partitions in the EventHub.
- Partition
Ids []string - The identifiers for the partitions of this EventHub.
- Resource
Group stringName
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- namespace
Name String - partition
Count Integer - The number of partitions in the EventHub.
- partition
Ids List<String> - The identifiers for the partitions of this EventHub.
- resource
Group StringName
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- namespace
Name string - partition
Count number - The number of partitions in the EventHub.
- partition
Ids string[] - The identifiers for the partitions of this EventHub.
- resource
Group stringName
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- namespace_
name str - partition_
count int - The number of partitions in the EventHub.
- partition_
ids Sequence[str] - The identifiers for the partitions of this EventHub.
- resource_
group_ strname
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- namespace
Name String - partition
Count Number - The number of partitions in the EventHub.
- partition
Ids List<String> - The identifiers for the partitions of this EventHub.
- resource
Group StringName
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi