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
LookupEventHubin 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.
- 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.
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 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 float The number of partitions in the EventHub.
- partition_
ids List[str] The identifiers for the partitions of this EventHub.
- resource_
group_ strname
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.