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

Kafka API default value causes namespace recreation #4773

Closed
cima opened this issue Oct 31, 2019 · 3 comments
Closed

Kafka API default value causes namespace recreation #4773

cima opened this issue Oct 31, 2019 · 3 comments

Comments

@cima
Copy link

cima commented Oct 31, 2019

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 "+1" or "me too" comments, 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

Terraform (and AzureRM Provider) Version

  • Terraform v0.11.13
  • provider.azurerm: version = "~> 1.35"

Affected Resource(s)

  • azurerm_eventhub_namespace

Terraform Configuration Files

terraform {
  backend "azurerm" {}
}
provider "azurerm" {}

# Directly taken from https://www.terraform.io/docs/providers/azurerm/r/eventhub_namespace.html
resource "azurerm_resource_group" "eventhub_terraform_bug" {
  name     = "eventhub-terraform-bug"
  location = "west europe"
}
resource "azurerm_eventhub_namespace" "eventhub_terraform_bug_namespace" {
  name                = "eventhub-terraform-bug"
  location            = "${azurerm_resource_group.eventhub_terraform_bug.location}"
  resource_group_name = "${azurerm_resource_group.eventhub_terraform_bug.name}"
  sku                 = "Standard"
}

Debug Output

Expected Behavior

If I create eventhub namespace without kafka_enable and run terraform repeatedly it doesn't recreate the resource.

Actual Behavior

Microsoft made Kafka API compulsory at new eventhub namespaces of Standard tier. Second and any consecusive execution of the script causes the eventhub namespace to be removed and created again.

Steps to Reproduce

  1. terraform apply
  2. terraform apply

See extensive project with detailed description at https://github.com/cima/eventhub-terraform-bug

Important facts

The SKU must be Standard.

References

@tombuildsstuff
Copy link
Contributor

hi @cima

Thanks for opening this issue.

The fix for this has been merged in #4743 which will be shipping as a part of v1.37 - since the fix for this has been merged I'm going to close this issue for the moment - however as I've assigned this to the 1.37 milestone @hashibot will comment here when this has been released.

In the interim it should be possible to work around this using an ignore_changes element within the lifecycle block to ignore the changes to this field, like so:

resource "azurerm_eventhub_namespace" "example" {
  # ...

  lifecycle {
    ignore_changes = [
      "kafka_enabled",
    ]
  }
}

Thanks!

@ghost
Copy link

ghost commented Nov 26, 2019

This has been released in version 1.37.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.37.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 30, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants