Azure Classic

v5.25.0 published on Thursday, Nov 24, 2022 by Pulumi

getEventHub

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.EventHub.GetEventHub.Invoke(new()
    {
        Name = "search-eventhub",
        ResourceGroupName = "search-service",
        NamespaceName = "search-eventhubns",
    });

    return new Dictionary<string, object?>
    {
        ["eventhubId"] = example.Apply(getEventHubResult => getEventHubResult.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.eventhub.EventhubFunctions;
import com.pulumi.azure.eventhub.inputs.GetEventHubArgs;
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) {
        final var example = EventhubFunctions.getEventHub(GetEventHubArgs.builder()
            .name("search-eventhub")
            .resourceGroupName("search-service")
            .namespaceName("search-eventhubns")
            .build());

        ctx.export("eventhubId", example.applyValue(getEventHubResult -> getEventHubResult.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)
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);
variables:
  example:
    Fn::Invoke:
      Function: azure:eventhub:getEventHub
      Arguments:
        name: search-eventhub
        resourceGroupName: search-service
        namespaceName: search-eventhubns
outputs:
  eventhubId: ${example.id}

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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azure:eventhub/getEventHub:getEventHub
  arguments:
    # arguments dictionary

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 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.

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.

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 Integer

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 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 int

The number of partitions in the EventHub.

partition_ids Sequence[str]

The identifiers for the partitions of this EventHub.

resource_group_name str
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 List<String>

The identifiers for the partitions of this EventHub.

resourceGroupName String

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.