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 name now allows the ~ character #1640

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions azurerm/helpers/azure/servicebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func ValidateServiceBusSubscriptionName() schema.SchemaValidateFunc {

func ValidateServiceBusTopicName() schema.SchemaValidateFunc {
return validation.StringMatch(
regexp.MustCompile("^[a-zA-Z][-._a-zA-Z0-9]{0,258}([a-zA-Z0-9])?$"),
"The topic name can contain only letters, numbers, periods, hyphens and underscores. The namespace must start with a letter, and it must end with a letter or number and be less then 260 characters long.",
regexp.MustCompile("^[a-zA-Z][-._~a-zA-Z0-9]{0,258}([a-zA-Z0-9])?$"),
"The topic name can contain only letters, numbers, periods, hyphens, tildas and underscores. The namespace must start with a letter, and it must end with a letter or number and be less then 260 characters long.",
)
}

Expand Down
7 changes: 4 additions & 3 deletions azurerm/resource_arm_servicebus_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ func resourceArmServiceBusTopic() *schema.Resource {

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: azure.ValidateServiceBusTopicName(),
},

"namespace_name": {
Expand Down
2 changes: 1 addition & 1 deletion examples/servicebus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "azurerm_servicebus_namespace_authorization_rule" "example" {
}

resource "azurerm_servicebus_topic" "source" {
name = "tfex_servicebus${random_integer.ri.result}_topic"
name = "tfex_servicebus${random_integer.ri.result}~topic"
resource_group_name = "${azurerm_resource_group.example.name}"
namespace_name = "${azurerm_servicebus_namespace.example.name}"

Expand Down