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

azurerm_servicebus_topic enable_partitioning validation for Premium #26642

Open
1 task done
jaredfholgate opened this issue Jul 15, 2024 · 5 comments · May be fixed by #26680
Open
1 task done

azurerm_servicebus_topic enable_partitioning validation for Premium #26642

jaredfholgate opened this issue Jul 15, 2024 · 5 comments · May be fixed by #26680

Comments

@jaredfholgate
Copy link
Contributor

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.

Description

If enable_partitioning is set to true and the referenced Service Bus namespace is Premium SKU, the validation should fail and it should not attempt to create or update the Topic.

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/servicebus_topic#enable_partitioning

The existing behaviour results in a plan to destroy and recreate the topic. The API then silently swallows the incorrect setting and the state still shows that enable_partitioning = false, even when desired state was true.

I appreciate this could is also an issue with how the API handles this, but it can be handled here in the provider to provide a better user experience.

New or Affected Resource(s)/Data Source(s)

azurerm_servicebus_topic

Potential Terraform Configuration

No change to existing configuration, just better validation.

References

None

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 16, 2024

Thanks @jaredfholgate for raising this issue. As mentioned in the doc, partitioning for premium namespace can only be configured during the namespace creation, not during the topic creation. If the partitioning is not enabled for the parent namespace, may I know the reason of setting the partitioning to true for the queue?
image

@jaredfholgate
Copy link
Contributor Author

jaredfholgate commented Jul 16, 2024

Hi. I agree it is there in the docs, but feedback from a Microsoft customer was that this is not enough. They had a production outage due to someone incorrectly setting this value and not reviewing the plan properly. I fully appreciate what I just said there and agree that this outage could easily have been avoided.

However the ask is to see if we can improve the provider given there is no other error shown in this scenario and the apply is not idempotent when this variable is set like this. Re-running the plan after an apply with this setting will result in another destroy and recreate plan.

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 17, 2024

@jaredfholgate That makes sense, thanks for bringing this up to us. Let me check the api behavior and see if we can add a validation. I will update the progress here.

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 18, 2024

@jaredfholgate I added the validation for servicebus topic entity, now there will be error if user tries to set the enable_partitioning to true for the non-partitioned namespace and vice versa.
image

@jaredfholgate
Copy link
Contributor Author

@jaredfholgate I added the validation for servicebus topic entity, now there will be error if user tries to set the enable_partitioning to true for the non-partitioned namespace and vice versa. image

Fantastic, thank you.

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