# AzureEventHubResource

- Module: [Aspire.Hosting.Azure.EventHubs](/reference/api/go/aspire.hosting.azure.eventhubs.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Represents an Azure Event Hub. Initializes a new instance of the `AzureEventHubResource` class.

## Definition

```go
type AzureEventHubResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithParent
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithParent`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the Azure Event Hub.
- `HubName`: `string` `get/set` -- The event hub name.
- `Parent`: [`AzureEventHubsResource`](/reference/api/go/aspire.hosting.azure.eventhubs/azureeventhubsresource.md) `get` -- Gets the parent Azure Event Hubs resource.
- `PartitionCount`: `*float64` `get/set` -- Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property

## Methods

- [AddConsumerGroup](/reference/api/go/aspire.hosting.azure.eventhubs/azureeventhubresource/addconsumergroup.md) -- `method` -- Adds an Azure Event Hub Consumer Group resource to the application model.
  ```go
  AddConsumerGroup(name string, options ...*AddConsumerGroupOptions) AzureEventHubConsumerGroupResource
  ```
- [WithProperties](/reference/api/go/aspire.hosting.azure.eventhubs/azureeventhubresource/withproperties.md) -- `method` -- Allows setting the properties of an Azure Event Hub resource.
  ```go
  WithProperties(configure func(obj AzureEventHubResource)) AzureEventHubResource
  ```
