Maryo David
Maryo David

Reputation: 589

Unable to create EventHub Authorization Rule in Azure using terraform

While trying to create EventHub Authorization Rule, getting the below error message. Not able to really get through this.

TF Code:

resource "azurerm_eventhub_authorization_rule" "jdBulkMessenger" {
  name                = "jd-bulk-messenger"
  namespace_name      = azurerm_eventhub_namespace.eventhub_ns.name
  eventhub_name       = azurerm_eventhub.eventhub.name
  resource_group_name = data.azurerm_resource_group.rg.name
  listen              = true
  send                = false
  manage              = false
}

Tried with Different Provider Version but the same issue persists:

terraform {
  required_providers {
    azurerm = {
      version = "~> 2.29.0"
    }
  }
}

Error:

Error: Error making Read request on Azure EventHub Authorization Rule : eventhub.EventHubsClient#GetAuthorizationRule: Invalid input: autorest/validation: validation failed: parameter=authorizationRuleName constraint=MinLength value="" details: value length must be greater than or equal to 1

Upvotes: 0

Views: 921

Answers (1)

kavya Saraboju
kavya Saraboju

Reputation: 10871

I tried to reproduce the same :

Even I had similar error Error: Error making Read request on Azure EventHub Authorization Rule: parameter=authorizationRuleName constraint=MinLength value="" details: value length must be greater than or equal to 1 when I had older arurerm provider version 2.15.0

Providers.tf

azurerm = {
      source  = "hashicorp/azurerm"
      version = "2.15.0"
    }

enter image description here

Then I changed the azurerm provider version to 3.0.2 and it worked .


enter image description here


  • Check if both AzureRM Provider and Terraform Core versions are old and upgrade to the latest versions as it may be fixed in latest versions.
  • Also check if that azurerm provider version is compatible with terraform core/ cli version such that it supports azurerm provider version in order to create authorization rules smoothly.

Upvotes: 1

Related Questions