-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
enable_partitioning not supported servicebus Premium Sku. #1391
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,19 @@ func resourceArmServiceBusTopicCreate(d *schema.ResourceData, meta interface{}) | |
parameters.SBTopicProperties.DuplicateDetectionHistoryTimeWindow = utils.String(duplicateWindow) | ||
} | ||
|
||
// We need to retrieve the namespace because Premium namespace works differently from Basic and Standard, | ||
// so it needs different rules applied to it. | ||
namespacesClient := meta.(*ArmClient).serviceBusNamespacesClient | ||
namespace, nsErr := namespacesClient.Get(ctx, resourceGroup, namespaceName) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Super minor, but can we make nsErr just err to keep it consistent in the codebase? |
||
if nsErr != nil { | ||
return nsErr | ||
} | ||
|
||
// In a Premium tier namespace, partitioning entities is not supported. | ||
if namespace.Sku.Name == servicebus.Premium && d.Get("enable_partitioning").(bool) { | ||
return fmt.Errorf("ServiceBus Queue (%s) does not support Partitioning enabled for Premium SKU", name) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gonna push a commit to remove this, since existing Namespaces should continue working |
||
|
||
_, err := client.CreateOrUpdate(ctx, resourceGroup, namespaceName, name, parameters) | ||
if err != nil { | ||
return err | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ func TestAccAzureRMServiceBusTopic_enablePartitioningPremium(t *testing.T) { | |
{ | ||
Config: postConfig, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr(resourceName, "enable_partitioning", "true"), | ||
resource.TestCheckResourceAttr(resourceName, "enable_partitioning", "false"), | ||
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't possible due to the API behaviour change/limitation |
||
resource.TestCheckResourceAttr(resourceName, "max_size_in_megabytes", "81920"), | ||
), | ||
}, | ||
|
@@ -349,7 +349,7 @@ resource "azurerm_servicebus_topic" "test" { | |
name = "acctestservicebustopic-%d" | ||
namespace_name = "${azurerm_servicebus_namespace.test.name}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
enable_partitioning = true | ||
enable_partitioning = false | ||
} | ||
`, rInt, location, rInt, rInt) | ||
} | ||
|
@@ -397,7 +397,7 @@ resource "azurerm_servicebus_topic" "test" { | |
name = "acctestservicebustopic-%d" | ||
namespace_name = "${azurerm_servicebus_namespace.test.name}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
enable_partitioning = true | ||
enable_partitioning = false | ||
max_size_in_megabytes = 81920 | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are changing the behavior can we update the documentation too with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gonna push a commit to remove this, since existing Namespaces should continue working