diff --git a/azurerm/internal/services/servicebus/parse/namespace_network_rule.go b/azurerm/internal/services/servicebus/parse/namespace_network_rule_set.go similarity index 68% rename from azurerm/internal/services/servicebus/parse/namespace_network_rule.go rename to azurerm/internal/services/servicebus/parse/namespace_network_rule_set.go index 7a42aafec960..7ea545d014b5 100644 --- a/azurerm/internal/services/servicebus/parse/namespace_network_rule.go +++ b/azurerm/internal/services/servicebus/parse/namespace_network_rule_set.go @@ -6,32 +6,32 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" ) -type ServiceBusNamespaceNetworkRuleId struct { +type ServiceBusNamespaceNetworkRuleSetId struct { Name string NamespaceName string ResourceGroup string } -func ServiceBusNamespaceNetworkRuleID(input string) (*ServiceBusNamespaceNetworkRuleId, error) { +func ServiceBusNamespaceNetworkRuleSetID(input string) (*ServiceBusNamespaceNetworkRuleSetId, error) { id, err := azure.ParseAzureResourceID(input) if err != nil { - return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule ID %q: %+v", input, err) + return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule Set ID %q: %+v", input, err) } - rule := ServiceBusNamespaceNetworkRuleId{ + rule := ServiceBusNamespaceNetworkRuleSetId{ ResourceGroup: id.ResourceGroup, } if rule.Name, err = id.PopSegment("networkrulesets"); err != nil { - return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule ID %q: %+v", input, err) + return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule Set ID %q: %+v", input, err) } if rule.NamespaceName, err = id.PopSegment("namespaces"); err != nil { - return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule ID %q: %+v", input, err) + return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule Set ID %q: %+v", input, err) } if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule ID %q: %+v", input, err) + return nil, fmt.Errorf("unable to parse Service Bus Namespace Network Rule Set ID %q: %+v", input, err) } return &rule, nil diff --git a/azurerm/internal/services/servicebus/parse/namespace_network_rule_test.go b/azurerm/internal/services/servicebus/parse/namespace_network_rule_set_test.go similarity index 93% rename from azurerm/internal/services/servicebus/parse/namespace_network_rule_test.go rename to azurerm/internal/services/servicebus/parse/namespace_network_rule_set_test.go index 853513eebc60..26b099011a39 100644 --- a/azurerm/internal/services/servicebus/parse/namespace_network_rule_test.go +++ b/azurerm/internal/services/servicebus/parse/namespace_network_rule_set_test.go @@ -7,7 +7,7 @@ func TestServiceBusNamespaceNetworkRuleID(t *testing.T) { Name string Input string Error bool - Expected *ServiceBusNamespaceNetworkRuleId + Expected *ServiceBusNamespaceNetworkRuleSetId }{ { Name: "Empty", @@ -47,7 +47,7 @@ func TestServiceBusNamespaceNetworkRuleID(t *testing.T) { { Name: "Service Bus Namespace Network Rule ID", Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.ServiceBus/namespaces/namespace1/networkrulesets/default", - Expected: &ServiceBusNamespaceNetworkRuleId{ + Expected: &ServiceBusNamespaceNetworkRuleSetId{ Name: "default", NamespaceName: "namespace1", ResourceGroup: "resGroup1", @@ -63,7 +63,7 @@ func TestServiceBusNamespaceNetworkRuleID(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Name) - actual, err := ServiceBusNamespaceNetworkRuleID(v.Input) + actual, err := ServiceBusNamespaceNetworkRuleSetID(v.Input) if err != nil { if v.Error { continue diff --git a/azurerm/internal/services/servicebus/registration.go b/azurerm/internal/services/servicebus/registration.go index e2f7bec5e7d1..71be9e539770 100644 --- a/azurerm/internal/services/servicebus/registration.go +++ b/azurerm/internal/services/servicebus/registration.go @@ -33,7 +33,7 @@ func (r Registration) SupportedResources() map[string]*schema.Resource { return map[string]*schema.Resource{ "azurerm_servicebus_namespace": resourceArmServiceBusNamespace(), "azurerm_servicebus_namespace_authorization_rule": resourceArmServiceBusNamespaceAuthorizationRule(), - "azurerm_servicebus_namespace_network_rule": resourceServiceBusNamespaceNetworkRule(), + "azurerm_servicebus_namespace_network_rule_set": resourceServiceBusNamespaceNetworkRuleSet(), "azurerm_servicebus_queue": resourceArmServiceBusQueue(), "azurerm_servicebus_queue_authorization_rule": resourceArmServiceBusQueueAuthorizationRule(), "azurerm_servicebus_subscription": resourceArmServiceBusSubscription(), diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule_set.go similarity index 83% rename from azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule.go rename to azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule_set.go index ed707013778d..266d33d44ab7 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_network_rule_set.go @@ -21,15 +21,15 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) -func resourceServiceBusNamespaceNetworkRule() *schema.Resource { +func resourceServiceBusNamespaceNetworkRuleSet() *schema.Resource { return &schema.Resource{ - Create: resourceServiceBusNamespaceNetworkRuleCreateUpdate, - Read: resourceServiceBusNamespaceNetworkRuleRead, - Update: resourceServiceBusNamespaceNetworkRuleCreateUpdate, - Delete: resourceServiceBusNamespaceNetworkRuleDelete, + Create: resourceServiceBusNamespaceNetworkRuleSetCreateUpdate, + Read: resourceServiceBusNamespaceNetworkRuleSetRead, + Update: resourceServiceBusNamespaceNetworkRuleSetCreateUpdate, + Delete: resourceServiceBusNamespaceNetworkRuleSetDelete, Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error { - _, err := parse.ServiceBusNamespaceNetworkRuleID(id) + _, err := parse.ServiceBusNamespaceNetworkRuleSetID(id) return err }), @@ -60,7 +60,7 @@ func resourceServiceBusNamespaceNetworkRule() *schema.Resource { }, false), }, - "ip_masks": { + "ip_rules": { Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{ @@ -93,7 +93,7 @@ func resourceServiceBusNamespaceNetworkRule() *schema.Resource { } } -func resourceServiceBusNamespaceNetworkRuleCreateUpdate(d *schema.ResourceData, meta interface{}) error { +func resourceServiceBusNamespaceNetworkRuleSetCreateUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).ServiceBus.NamespacesClientPreview ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -105,14 +105,14 @@ func resourceServiceBusNamespaceNetworkRuleCreateUpdate(d *schema.ResourceData, existing, err := client.GetNetworkRuleSet(ctx, resourceGroup, namespaceName) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("failed to check for presence of existing Service Bus Namespace Network Rule (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) + return fmt.Errorf("failed to check for presence of existing Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) } } // This resource is unique to the corresponding service bus namespace. // It will be created automatically along with the namespace, therefore we check whether this resource is identical to a "deleted" one if !CheckNetworkRuleNullified(existing) { - return tf.ImportAsExistsError("azurerm_servicebus_namespace_network_rule", *existing.ID) + return tf.ImportAsExistsError("azurerm_servicebus_namespace_network_rule_set", *existing.ID) } } @@ -120,32 +120,32 @@ func resourceServiceBusNamespaceNetworkRuleCreateUpdate(d *schema.ResourceData, NetworkRuleSetProperties: &servicebus.NetworkRuleSetProperties{ DefaultAction: servicebus.DefaultAction(d.Get("default_action").(string)), VirtualNetworkRules: expandServiceBusNamespaceVirtualNetworkRules(d.Get("network_rules").(*schema.Set).List()), - IPRules: expandServiceBusNamespaceIPRules(d.Get("ip_masks").(*schema.Set).List()), + IPRules: expandServiceBusNamespaceIPRules(d.Get("ip_rules").(*schema.Set).List()), }, } if _, err := client.CreateOrUpdateNetworkRuleSet(ctx, resourceGroup, namespaceName, parameters); err != nil { - return fmt.Errorf("failed to create Service Bus Namespace Network Rule (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) + return fmt.Errorf("failed to create Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) } resp, err := client.GetNetworkRuleSet(ctx, resourceGroup, namespaceName) if err != nil { - return fmt.Errorf("failed to retrieve Service Bus Namespace Network Rule (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) + return fmt.Errorf("failed to retrieve Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q): %+v", namespaceName, resourceGroup, err) } if resp.ID == nil || *resp.ID == "" { - return fmt.Errorf("cannot read Service Bus Namespace Network Rule (Namespace %q / Resource Group %q) ID", namespaceName, resourceGroup) + return fmt.Errorf("cannot read Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q) ID", namespaceName, resourceGroup) } d.SetId(*resp.ID) - return resourceServiceBusNamespaceNetworkRuleRead(d, meta) + return resourceServiceBusNamespaceNetworkRuleSetRead(d, meta) } -func resourceServiceBusNamespaceNetworkRuleRead(d *schema.ResourceData, meta interface{}) error { +func resourceServiceBusNamespaceNetworkRuleSetRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).ServiceBus.NamespacesClientPreview ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ServiceBusNamespaceNetworkRuleID(d.Id()) + id, err := parse.ServiceBusNamespaceNetworkRuleSetID(d.Id()) if err != nil { return err } @@ -153,11 +153,11 @@ func resourceServiceBusNamespaceNetworkRuleRead(d *schema.ResourceData, meta int resp, err := client.GetNetworkRuleSet(ctx, id.ResourceGroup, id.NamespaceName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[INFO] Service Bus Namespace Network Rule %q does not exist - removing from state", d.Id()) + log.Printf("[INFO] Service Bus Namespace Network Rule Set %q does not exist - removing from state", d.Id()) d.SetId("") return nil } - return fmt.Errorf("failed to read Service Bus Namespace Network Rule %q (Namespace %q / Resource Group %q): %+v", id.Name, id.NamespaceName, id.ResourceGroup, err) + return fmt.Errorf("failed to read Service Bus Namespace Network Rule Set %q (Namespace %q / Resource Group %q): %+v", id.Name, id.NamespaceName, id.ResourceGroup, err) } d.Set("namespace_name", id.NamespaceName) @@ -170,20 +170,20 @@ func resourceServiceBusNamespaceNetworkRuleRead(d *schema.ResourceData, meta int return fmt.Errorf("failed to set `network_rules`: %+v", err) } - if err := d.Set("ip_masks", flattenServiceBusNamespaceIPRules(props.IPRules)); err != nil { - return fmt.Errorf("failed to set `ip_masks`: %+v", err) + if err := d.Set("ip_rules", flattenServiceBusNamespaceIPRules(props.IPRules)); err != nil { + return fmt.Errorf("failed to set `ip_rules`: %+v", err) } } return nil } -func resourceServiceBusNamespaceNetworkRuleDelete(d *schema.ResourceData, meta interface{}) error { +func resourceServiceBusNamespaceNetworkRuleSetDelete(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).ServiceBus.NamespacesClientPreview ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ServiceBusNamespaceNetworkRuleID(d.Id()) + id, err := parse.ServiceBusNamespaceNetworkRuleSetID(d.Id()) if err != nil { return err } @@ -198,7 +198,7 @@ func resourceServiceBusNamespaceNetworkRuleDelete(d *schema.ResourceData, meta i } if _, err := client.CreateOrUpdateNetworkRuleSet(ctx, id.ResourceGroup, id.NamespaceName, parameters); err != nil { - return fmt.Errorf("failed to delete Service Bus Namespace Network Rule %q (Namespace %q / Resource Group %q): %+v", id.Name, id.NamespaceName, id.ResourceGroup, err) + return fmt.Errorf("failed to delete Service Bus Namespace Network Rule Set %q (Namespace %q / Resource Group %q): %+v", id.Name, id.NamespaceName, id.ResourceGroup, err) } return nil diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_set_test.go similarity index 88% rename from azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_test.go rename to azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_set_test.go index 36e6e6812337..1fd1da172ed3 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_network_rule_set_test.go @@ -14,7 +14,7 @@ import ( ) func TestAccAzureRMServiceBusNamespaceNetworkRule_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule", "test") + data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule_set", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -33,7 +33,7 @@ func TestAccAzureRMServiceBusNamespaceNetworkRule_basic(t *testing.T) { } func TestAccAzureRMServiceBusNamespaceNetworkRule_complete(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule", "test") + data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule_set", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -52,7 +52,7 @@ func TestAccAzureRMServiceBusNamespaceNetworkRule_complete(t *testing.T) { } func TestAccAzureRMServiceBusNamespaceNetworkRule_update(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule", "test") + data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule_set", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -85,7 +85,7 @@ func TestAccAzureRMServiceBusNamespaceNetworkRule_update(t *testing.T) { } func TestAccAzureRMServiceBusNamespaceNetworkRule_requiresImport(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule", "test") + data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_network_rule_set", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -110,17 +110,17 @@ func testCheckAzureRMServiceBusNamespaceNetworkRuleExists(resourceName string) r rs, ok := s.RootModule().Resources[resourceName] if !ok { - return fmt.Errorf("Service Bus Namespace Network Rule not found: %s", resourceName) + return fmt.Errorf("Service Bus Namespace Network Rule Set not found: %s", resourceName) } - id, err := parse.ServiceBusNamespaceNetworkRuleID(rs.Primary.ID) + id, err := parse.ServiceBusNamespaceNetworkRuleSetID(rs.Primary.ID) if err != nil { return err } if resp, err := client.GetNetworkRuleSet(ctx, id.ResourceGroup, id.NamespaceName); err != nil { if utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Service Bus Namespace Network Rule (Namespace %q / Resource Group %q) does not exist", id.NamespaceName, id.ResourceGroup) + return fmt.Errorf("Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q) does not exist", id.NamespaceName, id.ResourceGroup) } return fmt.Errorf("failed to GetNetworkRuleSet on ServiceBus.NamespacesClientPreview: %+v", err) } @@ -134,11 +134,11 @@ func testCheckAzureRMServiceBusNamespaceNetworkRuleDestroy(s *terraform.State) e ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext for _, rs := range s.RootModule().Resources { - if rs.Type != "azurerm_servicebus_namespace_network_rule" { + if rs.Type != "azurerm_servicebus_namespace_network_rule_set" { continue } - id, err := parse.ServiceBusNamespaceNetworkRuleID(rs.Primary.ID) + id, err := parse.ServiceBusNamespaceNetworkRuleSetID(rs.Primary.ID) if err != nil { return err } @@ -153,7 +153,7 @@ func testCheckAzureRMServiceBusNamespaceNetworkRuleDestroy(s *terraform.State) e } if !servicebus.CheckNetworkRuleNullified(resp) { - return fmt.Errorf("the Service Bus Namespace Network Rule (Namespace %q / Resource Group %q) still exists", id.NamespaceName, id.ResourceGroup) + return fmt.Errorf("the Service Bus Namespace Network Rule Set (Namespace %q / Resource Group %q) still exists", id.NamespaceName, id.ResourceGroup) } } @@ -165,7 +165,7 @@ func testAccAzureRMServiceBusNamespaceNetworkRule_basic(data acceptance.TestData return fmt.Sprintf(` %s -resource "azurerm_servicebus_namespace_network_rule" "test" { +resource "azurerm_servicebus_namespace_network_rule_set" "test" { namespace_name = azurerm_servicebus_namespace.test.name resource_group_name = azurerm_resource_group.test.name @@ -184,7 +184,7 @@ func testAccAzureRMServiceBusNamespaceNetworkRule_complete(data acceptance.TestD return fmt.Sprintf(` %s -resource "azurerm_servicebus_namespace_network_rule" "test" { +resource "azurerm_servicebus_namespace_network_rule_set" "test" { namespace_name = azurerm_servicebus_namespace.test.name resource_group_name = azurerm_resource_group.test.name @@ -195,7 +195,7 @@ resource "azurerm_servicebus_namespace_network_rule" "test" { ignore_missing_vnet_service_endpoint = false } - ip_masks = ["1.1.1.1"] + ip_rules = ["1.1.1.1"] } `, template) } @@ -244,9 +244,9 @@ func testAccAzureRMServiceBusNamespaceNetworkRule_requiresImport(data acceptance return fmt.Sprintf(` %s -resource "azurerm_servicebus_namespace_network_rule" "import" { - namespace_name = azurerm_servicebus_namespace_network_rule.test.namespace_name - resource_group_name = azurerm_servicebus_namespace_network_rule.test.resource_group_name +resource "azurerm_servicebus_namespace_network_rule_set" "import" { + namespace_name = azurerm_servicebus_namespace_network_rule_set.test.namespace_name + resource_group_name = azurerm_servicebus_namespace_network_rule_set.test.resource_group_name } `, template) } diff --git a/azurerm/internal/services/servicebus/validate/namespace_network_rule.go b/azurerm/internal/services/servicebus/validate/namespace_network_rule.go deleted file mode 100644 index a75ebb6e4829..000000000000 --- a/azurerm/internal/services/servicebus/validate/namespace_network_rule.go +++ /dev/null @@ -1,34 +0,0 @@ -package validate - -import ( - "fmt" - - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/parse" -) - -func ServiceBusNamespaceNetworkRuleID(i interface{}, k string) (warnings []string, errors []error) { - v, ok := i.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) - return - } - - if _, err := parse.ServiceBusNamespaceNetworkRuleID(v); err != nil { - errors = append(errors, fmt.Errorf("cannot parse %q as a Service Bus Namespace Network Rule ID: %+v", k, err)) - return - } - - return warnings, errors -} - -func ServiceBusNamespaceNetworkRuleName(i interface{}, k string) (warnings []string, errors []error) { - _, ok := i.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) - return - } - - // TODO -- investigate the naming rule - - return warnings, errors -} diff --git a/azurerm/internal/services/servicebus/validate/namespace_network_rule_set.go b/azurerm/internal/services/servicebus/validate/namespace_network_rule_set.go new file mode 100644 index 000000000000..5c7700a4802e --- /dev/null +++ b/azurerm/internal/services/servicebus/validate/namespace_network_rule_set.go @@ -0,0 +1,22 @@ +package validate + +import ( + "fmt" + + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/parse" +) + +func ServiceBusNamespaceNetworkRuleSetID(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return + } + + if _, err := parse.ServiceBusNamespaceNetworkRuleSetID(v); err != nil { + errors = append(errors, fmt.Errorf("cannot parse %q as a Service Bus Namespace Network Rule Set ID: %+v", k, err)) + return + } + + return warnings, errors +} diff --git a/website/azurerm.erb b/website/azurerm.erb index d61f58f18942..5a2c9495b5ea 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -1788,7 +1788,7 @@
  • - azurerm_servicebus_namespace_network_rule + azurerm_servicebus_namespace_network_rule_set
  • diff --git a/website/docs/r/servicebus_namespace_network_rule.html.markdown b/website/docs/r/servicebus_namespace_network_rule_set.html.markdown similarity index 69% rename from website/docs/r/servicebus_namespace_network_rule.html.markdown rename to website/docs/r/servicebus_namespace_network_rule_set.html.markdown index 823b173f2c82..921739bd499e 100644 --- a/website/docs/r/servicebus_namespace_network_rule.html.markdown +++ b/website/docs/r/servicebus_namespace_network_rule_set.html.markdown @@ -1,14 +1,14 @@ --- subcategory: "Messaging" layout: "azurerm" -page_title: "Azure Resource Manager: azurerm_servicebus_namespace_network_rule" +page_title: "Azure Resource Manager: azurerm_servicebus_namespace_network_rule_set" description: |- - Manages a ServiceBus Namespace Network Rule. + Manages a ServiceBus Namespace Network Rule Set Set. --- -# azurerm_servicebus_namespace_network_rule +# azurerm_servicebus_namespace_network_rule_set -Manages a ServiceBus Namespace Network Rule. +Manages a ServiceBus Namespace Network Rule Set Set. ## Example Usage @@ -48,7 +48,7 @@ resource "azurerm_subnet" "example" { service_endpoints = ["Microsoft.ServiceBus"] } -resource "azurerm_servicebus_namespace_network_rule" "example" { +resource "azurerm_servicebus_namespace_network_rule_set" "example" { namespace_name = azurerm_servicebus_namespace.example.name resource_group_name = azurerm_resource_group.example.name @@ -59,7 +59,7 @@ resource "azurerm_servicebus_namespace_network_rule" "example" { ignore_missing_vnet_service_endpoint = false } - ip_masks = ["1.1.1.1"] + ip_rules = ["1.1.1.1"] } ``` @@ -67,15 +67,15 @@ resource "azurerm_servicebus_namespace_network_rule" "example" { The following arguments are supported: -* `resource_group_name` - (Required) Specifies the name of the Resource Group where the ServiceBus Namespace Network Rule should exist. Changing this forces a new resource to be created. +* `resource_group_name` - (Required) Specifies the name of the Resource Group where the ServiceBus Namespace Network Rule Set should exist. Changing this forces a new resource to be created. -* `namespace_name` - (Required) Specifies the ServiceBus Namespace name to which to attach the ServiceBus Namespace Network Rule. Changing this forces a new resource to be created. +* `namespace_name` - (Required) Specifies the ServiceBus Namespace name to which to attach the ServiceBus Namespace Network Rule Set. Changing this forces a new resource to be created. -~> **NOTE:** The ServiceBus Namespace must be `Premium` in order to attach a ServiceBus Namespace Network Rule. +~> **NOTE:** The ServiceBus Namespace must be `Premium` in order to attach a ServiceBus Namespace Network Rule Set. -* `default_action` - (Optional) Specifies the default action for the ServiceBus Namespace Network Rule. Possible values are `Allow` and `Deny`. Defaults to `Deny`. +* `default_action` - (Optional) Specifies the default action for the ServiceBus Namespace Network Rule Set. Possible values are `Allow` and `Deny`. Defaults to `Deny`. -* `ip_masks` - (Optional) A list of IP filter masks that are added to allow access to the ServiceBus Namespace. +* `ip_rules` - (Optional) A list of IP filter masks that are added to allow access to the ServiceBus Namespace. * `network_rules` - (Optional) One or more `network_rules` blocks defined below. @@ -85,27 +85,27 @@ A `network_rules` block supports the following: * `subnet_id` - (Required) The ID of the subnet you want to allow to access the corresponding ServiceBus Namespace. -* `ignore_missing_vnet_service_endpoint` - (Optional) Should the ServiceBus Namespace Network Rule ignore missing Virtual Network Service Endpoint option in the Subnet? Defaults to `false`. +* `ignore_missing_vnet_service_endpoint` - (Optional) Should the ServiceBus Namespace Network Rule Set ignore missing Virtual Network Service Endpoint option in the Subnet? Defaults to `false`. ## Attributes Reference The following attributes are exported: -* `id` - The ID of the ServiceBus Namespace Network Rule. +* `id` - The ID of the ServiceBus Namespace Network Rule Set. ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the ServiceBus Namespace Network Rule. -* `update` - (Defaults to 30 minutes) Used when updating the ServiceBus Namespace Network Rule. -* `read` - (Defaults to 5 minutes) Used when retrieving the ServiceBus Namespace Network Rule. -* `delete` - (Defaults to 30 minutes) Used when deleting the ServiceBus Namespace Network Rule. +* `create` - (Defaults to 30 minutes) Used when creating the ServiceBus Namespace Network Rule Set. +* `update` - (Defaults to 30 minutes) Used when updating the ServiceBus Namespace Network Rule Set. +* `read` - (Defaults to 5 minutes) Used when retrieving the ServiceBus Namespace Network Rule Set. +* `delete` - (Defaults to 30 minutes) Used when deleting the ServiceBus Namespace Network Rule Set. ## Import Service Bus Namespace can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_servicebus_namespace_network_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Servicebus/namespaces/sbns1/networkrulesets/default +terraform import azurerm_servicebus_namespace_network_rule_set.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Servicebus/namespaces/sbns1/networkrulesets/default ```