Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Update Partition Count on a Dedicated Event Hub Cluster #28328

Open
1 task done
ivanbok opened this issue Dec 18, 2024 · 0 comments
Open
1 task done

Cannot Update Partition Count on a Dedicated Event Hub Cluster #28328

ivanbok opened this issue Dec 18, 2024 · 0 comments

Comments

@ivanbok
Copy link

ivanbok commented Dec 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.6

AzureRM Provider Version

4.14.0

Affected Resource(s)/Data Source(s)

azurerm_eventhub

Terraform Configuration Files

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "4.14.0"
    }
  }
}

provider "azurerm" {
  features {}
  subscription_id = "<subscription_id>"
}
# Resource Group
resource "azurerm_resource_group" "eventhub_terraform_test" {
  name     = "eventhub_terraform_test"
  location = "Southeast Asia"
}

resource "azurerm_eventhub_cluster" "my-terraform-eventhub-cluster" {
  name                = "my-terraform-eventhub-cluster"
  resource_group_name = azurerm_resource_group.eventhub_terraform_test.name
  location            = azurerm_resource_group.eventhub_terraform_test.location
  sku_name            = "Dedicated_1"
}

resource "azurerm_eventhub_namespace" "my-namespace" {
  name                = "my-terraform-eventhub-namespace"
  location            = azurerm_resource_group.eventhub_terraform_test.location
  resource_group_name = azurerm_resource_group.eventhub_terraform_test.name
  sku                 = "Standard"
  capacity            = 1 # Required for standard namespace
  dedicated_cluster_id = azurerm_eventhub_cluster.my-terraform-eventhub-cluster.id
}

resource "azurerm_eventhub" "my-eh-instance" {
  name              = "my-eh-01"
  namespace_id      = azurerm_eventhub_namespace.my-namespace.id
  partition_count   = 3
  message_retention = 1
}

Debug Output/Panic Output

│ Error: `partition_count` cannot be changed unless the namespace sku is `Premium`
│
│   with azurerm_eventhub.my-eh-instance,
│   on eventhub.tf line 44, in resource "azurerm_eventhub" "my-eh-instance":
│   44: resource "azurerm_eventhub" "my-eh-instance" {
│

Expected Behaviour

Event Hubs in dedicated clusters should have partition counts that can be modified after creation. Changing the partition counts for such event hubs work in the Azure Portal and via the Azure CLI:

via Azure CLI (works):

az eventhubs eventhub update \
  --resource-group eventhub_terraform_test \
  --namespace-name my-terraform-eventhub-namespace \
  --name my-eh-instance \
  --partition-count 4

via Terraform (failure)

resource "azurerm_eventhub" "my-eh-instance" {
  name              = "my-eh-01"
  namespace_id      = azurerm_eventhub_namespace.my-namespace.id
  partition_count   = 3
  message_retention = 1
}

Expected Behavior: Terraform should successfully update the partition_count for the Event Hub

Supporting Notes:
For dedicated clusters, the "Standard" SKU must be used for the Event Hub instance. If Premium is specified, the following error appears:

│ Namespace Name: "my-namespace"): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: PremiumOrBasicEHNamespacesNotSupportedOnDedicateEHCluster: Premium or Basic SKU Namespaces are not supported on Dedicated EventHub clusters. Please use Standard SKU instead.
│
│   with azurerm_eventhub_namespace.my-namespace,
│
│   with azurerm_eventhub_namespace.my-namespace,
│   on eventhub.tf line 36, in resource "azurerm_eventhub_namespace" "my-namespace":
│   36: resource "azurerm_eventhub_namespace" "my-namespace" {

Actual Behaviour

Actual Behavior: Terraform fails with the error:

Error: 'partition_count' cannot be changed unless the namespace sku is 'Premium'

Steps to Reproduce

  1. Use the sample TF file (modifying the namespace to be globally unique and using your subscription ID), and run terraform apply
  2. Update the partition_count of the Event Hub in the Terraform config file (e.g. change from 3 to 4)
  3. Re-run terraform apply

Important Factoids

No response

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant