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

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_eventhub_authorization_rule"
     4  sidebar_current: "docs-azurerm-resource-eventhub-authorization-rule"
     5  description: |-
     6    Creates a new Event Hub Authorization Rule within an Event Hub.
     7  ---
     8  
     9  # azurerm\_eventhub\_authorization\_rule
    10  
    11  Creates a new Event Hub Authorization Rule 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_authorization_rule" "test" {
    43    name                = "navi"
    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    listen              = true
    49    send                = false
    50    manage              = false
    51  }
    52  ```
    53  
    54  ## Argument Reference
    55  
    56  The following arguments are supported:
    57  
    58  * `name` - (Required) Specifies the name of the EventHub Authorization Rule resource. Changing this forces a new resource to be created.
    59  
    60  * `namespace_name` - (Required) Specifies the name of the grandparent EventHub Namespace. Changing this forces a new resource to be created.
    61  
    62  * `eventhub_name` - (Required) Specifies the name of the EventHub. Changing this forces a new resource to be created.
    63  
    64  * `resource_group_name` - (Required) The name of the resource group in which the EventHub Namespace exists. Changing this forces a new resource to be created.
    65  
    66  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    67  
    68  ~> **NOTE** At least one of the 3 permissions below needs to be set.
    69  
    70  * `listen` - (Optional) Does this Authorization Rule have permissions to Listen to the Event Hub? Defaults to `false`.
    71  
    72  * `send` - (Optional) Does this Authorization Rule have permissions to Send to the Event Hub? Defaults to `false`.
    73  
    74  * `manage` - (Optional) Does this Authorization Rule have permissions to Manage to the Event Hub? When this property is `true` - both `listen` and `send` must be too. Defaults to `false`.
    75  
    76  ## Attributes Reference
    77  
    78  The following attributes are exported:
    79  
    80  * `id` - The EventHub ID.
    81  
    82  * `primary_key` - The Primary Key for the Event Hub Authorization Rule.
    83  
    84  * `primary_connection_string` - The Primary Connection String for the Event Hub Authorization Rule.
    85  
    86  * `secondary_key` - The Secondary Key for the Event Hub Authorization Rule.
    87  
    88  * `secondary_connection_string` - The Secondary Connection String for the Event Hub Authorization Rule.
    89  
    90  ## Import
    91  
    92  EventHubs can be imported using the `resource id`, e.g.
    93  
    94  ```
    95  terraform import azurerm_eventhub_authorization_rule.rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/eventhubs/eventhub1/authorizationRules/rule1
    96  ```