# AddConsumerGroup

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

Adds an Azure Event Hub Consumer Group resource to the application model.

## Definition

```go
func (AzureEventHubResource) AddConsumerGroup(
    name string,
    options ...*AddConsumerGroupOptions,
) AzureEventHubConsumerGroupResource
```

## Parameters

- `name` (`string`) -- The name of the Event Hub Consumer Group resource.
- `options` (`...*AddConsumerGroupOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddConsumerGroupOptions` argument.

- `GroupName` (`*string`) -- The name of the Consumer Group. If not provided, this defaults to the same value as `name`.

## Returns

[`AzureEventHubConsumerGroupResource`](/reference/api/go/aspire.hosting.azure.eventhubs/azureeventhubconsumergroupresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureEventHubResource`](/reference/api/go/aspire.hosting.azure.eventhubs/azureeventhubresource.md)
