get Event Hub
Use this data source to access information about an existing EventHub.
Example Usage
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);
Content copied to clipboard
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)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
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),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/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
})
}
Content copied to clipboard
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()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:eventhub:getEventHub
arguments:
name: search-eventhub
resourceGroupName: search-service
namespaceName: search-eventhubns
outputs:
eventhubId: ${example.id}
Content copied to clipboard
Return
A collection of values returned by getEventHub.
Parameters
argument
A collection of arguments for invoking getEventHub.
suspend fun getEventHub(name: String, namespaceName: String, resourceGroupName: String): GetEventHubResult
Return
A collection of values returned by getEventHub.
Parameters
name
The name of this EventHub.
namespace Name
The name of the EventHub Namespace where the EventHub exists.
resource Group Name
The name of the Resource Group where the EventHub exists.
See also
suspend fun getEventHub(argument: suspend GetEventHubPlainArgsBuilder.() -> Unit): GetEventHubResult
Return
A collection of values returned by getEventHub.
Parameters
argument
Builder for com.pulumi.azure.eventhub.kotlin.inputs.GetEventHubPlainArgs.