github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/azurerm/r/eventhub_consumer_group.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_eventhub_consumer_group"
     4  sidebar_current: "docs-azurerm-resource-eventhub-consumer-group"
     5  description: |-
     6    Creates a new Event Hub Consumer Group as a nested resource within an Event Hub.
     7  ---
     8  
     9  # azurerm\_eventhub\_consumer\_group
    10  
    11  Creates a new Event Hub Consumer Group as a nested resource within an Event Hub.
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "azurerm_resource_group" "test" {
    17    name     = "resourceGroup1"
    18    location = "West US"
    19  }
    20  
    21  resource "azurerm_eventhub_namespace" "test" {
    22    name                = "acceptanceTestEventHubNamespace"
    23    location            = "West US"
    24    resource_group_name = "${azurerm_resource_group.test.name}"
    25    sku                 = "Basic"
    26    capacity            = 2
    27  
    28    tags {
    29      environment = "Production"
    30    }
    31  }
    32  
    33  resource "azurerm_eventhub" "test" {
    34    name                = "acceptanceTestEventHub"
    35    namespace_name      = "${azurerm_eventhub_namespace.test.name}"
    36    location            = "${azurerm_resource_group.test.location}"
    37    resource_group_name = "${azurerm_resource_group.test.name}"
    38    partition_count     = 2
    39    message_retention   = 2
    40  }
    41  
    42  resource "azurerm_eventhub_consumer_group" "test" {
    43    name                = "acceptanceTestEventHubConsumerGroup"
    44    namespace_name      = "${azurerm_eventhub_namespace.test.name}"
    45    eventhub_name       = "${azurerm_eventhub.test.name}"
    46    resource_group_name = "${azurerm_resource_group.test.name}"
    47    location            = "${azurerm_resource_group.test.location}"
    48    user_metadata       = "some-meta-data"
    49  }
    50  ```
    51  
    52  ## Argument Reference
    53  
    54  The following arguments are supported:
    55  
    56  * `name` - (Required) Specifies the name of the EventHub Consumer Group resource. Changing this forces a new resource to be created.
    57  
    58  * `namespace_name` - (Required) Specifies the name of the grandparent EventHub Namespace. Changing this forces a new resource to be created.
    59  
    60  * `eventhub_name` - (Required) Specifies the name of the EventHub. Changing this forces a new resource to be created.
    61  
    62  * `resource_group_name` - (Required) The name of the resource group in which the EventHub Consumer Group's grandparent Namespace exists. Changing this forces a new resource to be created.
    63  
    64  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    65  
    66  * `user_metadata` - (Optional) Specifies the user metadata.
    67  
    68  ## Attributes Reference
    69  
    70  The following attributes are exported:
    71  
    72  * `id` - The EventHub Consumer Group ID.
    73  
    74  ## Import
    75  
    76  EventHub Consumer Groups can be imported using the `resource id`, e.g.
    77  
    78  ```
    79  terraform import azurerm_eventhub_consumer_group.consumerGroup1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/eventhubs/eventhub1/consumergroups/consumerGroup1
    80  ```