github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/azurerm/r/eventhub.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azurerm_eventhub" 4 sidebar_current: "docs-azurerm-resource-eventhub" 5 description: |- 6 Creates a new Event Hub as a nested resource within an Event Hub Namespace. 7 --- 8 9 # azurerm\_eventhub 10 11 Creates a new Event Hub as a nested resource within a Event Hub Namespace. 12 13 ## Example Usage 14 15 ``` 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 43 ## Argument Reference 44 45 The following arguments are supported: 46 47 * `name` - (Required) Specifies the name of the EventHub Namespace resource. Changing this forces a new resource to be created. 48 49 * `namespace_name` - (Required) Specifies the name of the EventHub Namespace. Changing this forces a new resource to be created. 50 51 * `resource_group_name` - (Required) The name of the resource group in which the EventHub's parent Namespace exists. Changing this forces a new resource to be created. 52 53 * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. 54 55 * `partition_count` - (Required) Specifies the current number of shards on the Event Hub. 56 57 * `message_retention` - (Required) Specifies the number of days to retain the events for this Event Hub. Needs to be between 1 and 7 days; or 1 day when using a Basic SKU for the parent EventHub Namespace. 58 59 ## Attributes Reference 60 61 The following attributes are exported: 62 63 * `id` - The EventHub ID. 64 65 * `partition_ids` - The identifiers for partitions created for Event Hubs. 66 67 ## Import 68 69 EventHubs can be imported using the `resource id`, e.g. 70 71 ``` 72 terraform import azurerm_eventhub.eventhub1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/eventhubs/eventhub1 73 ```