-
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
service_bus_queue: support for max_delivery_count
#2028
Merged
tombuildsstuff
merged 6 commits into
hashicorp:master
from
tkbky:service-bus-queue-max-delivery-count
Oct 10, 2018
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a9ea496
service_bus_queue: support for `max_delivery_count`
tkbky 8b43bd9
Fix service bus queue test
tkbky 4da8554
Add import check step in service bus queue test
tkbky 6c0e433
Read max delivery count
tkbky 222388a
Validate that max delivery count is at least 1
tkbky d83860d
Fix alignment and missing import
tkbky 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,33 @@ func TestAccAzureRMServiceBusQueue_isoTimeSpanAttributes(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAzureRMServiceBusQueue_maxDeliveryCount(t *testing.T) { | ||
resourceName := "azurerm_servicebus_queue.test" | ||
location := testLocation() | ||
ri := acctest.RandInt() | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMServiceBusQueueDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccAzureRMServiceBusQueue_basic(ri, location), | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMServiceBusQueueExists(resourceName), | ||
resource.TestCheckResourceAttr(resourceName, "max_delivery_count", "10"), | ||
), | ||
}, | ||
{ | ||
Config: testAccAzureRMServiceBusQueue_maxDeliveryCount(ri, location), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr(resourceName, "max_delivery_count", "20"), | ||
), | ||
}, | ||
}, | ||
katbyte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}) | ||
} | ||
|
||
func testCheckAzureRMServiceBusQueueDestroy(s *terraform.State) error { | ||
client := testAccProvider.Meta().(*ArmClient).serviceBusQueuesClient | ||
ctx := testAccProvider.Meta().(*ArmClient).StopContext | ||
|
@@ -551,3 +578,26 @@ resource "azurerm_servicebus_queue" "test" { | |
} | ||
`, rInt, location, rInt, rInt) | ||
} | ||
|
||
func testAccAzureRMServiceBusQueue_maxDeliveryCount(rInt int, location string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" | ||
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. Could we align all the assignments in the TF code to match the other tests? 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. Definitely. Sorry for not noticing the inconsistency. |
||
location = "%s" | ||
} | ||
|
||
resource "azurerm_servicebus_namespace" "test" { | ||
name = "acctestservicebusnamespace-%d" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
location = "${azurerm_resource_group.test.location}" | ||
sku = "standard" | ||
} | ||
|
||
resource "azurerm_servicebus_queue" "test" { | ||
name = "acctestservicebusqueue-%d" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
namespace_name = "${azurerm_servicebus_namespace.test.name}" | ||
max_delivery_count = 20 | ||
} | ||
`, rInt, location, rInt, rInt) | ||
} |
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
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.
out of interest where does this default value come from? (and if so, are there any validation requirements for this field?)
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.
It's coming from the doc over here, not sure about the validation requirements though.
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.
I was able to set it to
999999999
but it does have to be at least1
so we could go withvalidation.IntAtleast(1)
?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.
@katbyte yes, having it to be at least
1
makes sense to me.