Azure Messaging Namespace Authorization Rule

This page shows how to write Terraform and Azure Resource Manager for Messaging Namespace Authorization Rule and write them securely.

azurerm_eventhub_namespace_authorization_rule (Terraform)

The Namespace Authorization Rule in Messaging can be configured in Terraform with the resource name azurerm_eventhub_namespace_authorization_rule. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_eventhub_namespace_authorization_rule" "authorization_rule" {
  name                = var.authorization_rule_name
  namespace_name      = var.event_hub_namespace
  resource_group_name = var.resource_group_name
  listen              = true
  send                = true
main.tf#L43
resource "azurerm_eventhub_namespace_authorization_rule" "view_auth_rule" {
  depends_on          = [azurerm_eventhub_namespace.eventhubs, azurerm_eventhub.topic]
  name                = "view"
  namespace_name      = azurerm_eventhub_namespace.eventhubs.name
  resource_group_name = azurerm_eventhub_namespace.eventhubs.resource_group_name

auth_rules.tf#L11
resource "azurerm_eventhub_namespace_authorization_rule" "evh_ns_rule" {
  name                = azurecaf_name.evh_ns_rule_name.result
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
  listen              = var.settings.listen
  send                = var.settings.send
auth_rules.tf#L2
resource "azurerm_eventhub_namespace_authorization_rule" "evh_ns_rule" {
  name                = var.settings.rule_name
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
  listen              = var.settings.listen
  send                = var.settings.send
auth_rules.tf#L11
resource "azurerm_eventhub_namespace_authorization_rule" "evh_ns_rule" {
  name                = azurecaf_name.evh_ns_rule_name.result
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
  listen              = var.settings.listen
  send                = var.settings.send
auth_rules.tf#L11
resource "azurerm_eventhub_namespace_authorization_rule" "evh_ns_rule" {
  name                = azurecaf_name.evh_ns_rule_name.result
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
  listen              = var.settings.listen
  send                = var.settings.send
main.tf#L7
resource "azurerm_eventhub_namespace_authorization_rule" "this" {
  listen              = var.listen
  manage              = var.manage
  name                = var.name
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
eventhub.tf#L63
resource "azurerm_eventhub_namespace_authorization_rule" "eventhub_rule" {
  name                              = var.eventhub_rule_name
  namespace_name                    = azurerm_eventhub_namespace.eventhub_ns.name
  resource_group_name               = var.resource_group_name

  listen                            = local.listen
main.tf#L46
resource "azurerm_eventhub_namespace_authorization_rule" "eventhub_ns_az_rule" {
  count               = var.create_eventhub_ns_authorization_rule ? 1 : 0
  name                = var.eventhub_authorization_rule_name
  namespace_name      = azurerm_eventhub_namespace.event_hub_namespace.name
  resource_group_name = var.resource_group_name
  listen              = var.eventhub_ns_authorization_rule_listen
main.tf#L7
resource "azurerm_eventhub_namespace_authorization_rule" "this" {
  listen              = var.listen
  manage              = var.manage
  name                = var.name
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an Authorization Rule for an Event Hub Namespace.

Microsoft.EventHub/namespaces/authorizationRules (Azure Resource Manager)

The namespaces/authorizationRules in Microsoft.EventHub can be configured in Azure Resource Manager with the resource name Microsoft.EventHub/namespaces/authorizationRules. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • name required - string

    The authorization rule name.

  • properties required
      • rights required - array

        The rights associated with the rule.

  • type required - string

Frequently asked questions

What is Azure Messaging Namespace Authorization Rule?

Azure Messaging Namespace Authorization Rule is a resource for Messaging of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Messaging Namespace Authorization Rule?

For Terraform, the prashant101386/devops, chesapeaketechnology/data-science and aztfmod/terraform-azurerm-caf source code examples are useful. See the Terraform Example section for further details.