We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
azure.eventhub.getEventHub
Explore with Pulumi AI
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);
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)
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
})
}
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),
};
});
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()));
}
}
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.
- 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
azurerm
Terraform Provider.