-
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
azurerm_servicebus_namespace
- support for the premium_messaging_partitions
property
#24676
Merged
katbyte
merged 12 commits into
hashicorp:main
from
xiaxyi:sb/addPremiumMessagingPartition
Feb 20, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
422e28c
add premium messaging partition property
xiaxyi 30bef91
âfix test case
xiaxyi 8aab8d2
change property value in test cases
xiaxyi 3517ace
change docs and test cases based on reviewer
xiaxyi 1b8ed3a
update docs and test cases
xiaxyi 316d2cd
terrafmt
xiaxyi 339cfba
Merge remote-tracking branch 'upstream/main' into sb/addPremiumMessag…
xiaxyi bfb465f
update test case
xiaxyi fa717a2
Merge remote-tracking branch 'upstream/main' into sb/addPremiumMessag…
xiaxyi f6f7c6f
update test case for premium namespace
xiaxyi d58297b
update
xiaxyi 5d58bd1
format test cases
xiaxyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,17 @@ func TestAccAzureRMServiceBusNamespace_premiumCapacity(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAzureRMServiceBusNamespace_premiumMessagingPartition(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace", "test") | ||
r := ServiceBusNamespaceResource{} | ||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.premiumMessagingPartition(data), | ||
ExpectError: regexp.MustCompile("Service Bus SKU \"Premium\" only supports `premium_messaging_partitions` of 1, 2, 4"), | ||
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 doesn't match the schema validation above? 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. The validation error is for the premium namespaces |
||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMServiceBusNamespace_zoneRedundant(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace", "test") | ||
r := ServiceBusNamespaceResource{} | ||
|
@@ -404,11 +415,12 @@ resource "azurerm_resource_group" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 4 | ||
premium_messaging_partitions = 1 | ||
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
@@ -445,12 +457,34 @@ resource "azurerm_resource_group" "test" { | |
location = "%s" | ||
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 0 | ||
premium_messaging_partitions = 1 | ||
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
||
func (ServiceBusNamespaceResource) premiumMessagingPartition(data acceptance.TestData) string { | ||
return fmt.Sprintf(` | ||
provider "azurerm" { | ||
features {} | ||
} | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" | ||
location = "%s" | ||
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 0 | ||
capacity = 2 | ||
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
@@ -467,12 +501,13 @@ resource "azurerm_resource_group" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
zone_redundant = true | ||
name = "acctestservicebusnamespace-%d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
premium_messaging_partitions = 1 | ||
capacity = 1 | ||
zone_redundant = true | ||
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) | ||
} | ||
|
@@ -631,11 +666,12 @@ resource "azurerm_key_vault_key" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%[2]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
name = "acctestservicebusnamespace-%[2]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
premium_messaging_partitions = 1 | ||
capacity = 1 | ||
identity { | ||
type = "UserAssigned" | ||
|
@@ -724,11 +760,12 @@ resource "azurerm_subnet" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
premium_messaging_partitions = 1 | ||
network_rule_set { | ||
default_action = "Deny" | ||
|
@@ -771,12 +808,12 @@ resource "azurerm_subnet" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
premium_messaging_partitions = 1 | ||
network_rule_set { | ||
default_action = "Deny" | ||
trusted_services_allowed = true | ||
|
@@ -822,11 +859,12 @@ resource "azurerm_subnet" "test" { | |
} | ||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
name = "acctestservicebusnamespace-%[1]d" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
sku = "Premium" | ||
capacity = 1 | ||
premium_messaging_partitions = 1 | ||
network_rule_set {} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This doesn't match the schema validation above? The property defaults to
0
also.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.
This is for the premium namespace, 0 is not a valid value for premium namespace.