provider/azurerm: Fix azurerm_network_security_group_rule

```
HTTP_PROXY=http://localhost:8888 make testacc TEST=./builtin/providers/azurerm TESTARGS="-run TestAccAzureRMNetworkSecurityRule_"
==> Checking that code complies with gofmt requirements...
/Users/James/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/06/01 19:19:59 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMNetworkSecurityRule_ -timeout 120m
=== RUN   TestAccAzureRMNetworkSecurityRule_basic
--- PASS: TestAccAzureRMNetworkSecurityRule_basic (105.61s)
=== RUN   TestAccAzureRMNetworkSecurityRule_addingRules
--- PASS: TestAccAzureRMNetworkSecurityRule_addingRules (141.59s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    247.221s
```
This commit is contained in:
James Nugent 2016-06-01 19:25:19 -05:00
parent 2f66747e79
commit 8ecfddf507
3 changed files with 412 additions and 427 deletions

View File

@ -51,15 +51,15 @@ func Provider() terraform.ResourceProvider {
"azurerm_local_network_gateway": resourceArmLocalNetworkGateway(), "azurerm_local_network_gateway": resourceArmLocalNetworkGateway(),
"azurerm_network_interface": resourceArmNetworkInterface(), "azurerm_network_interface": resourceArmNetworkInterface(),
"azurerm_network_security_group": resourceArmNetworkSecurityGroup(), "azurerm_network_security_group": resourceArmNetworkSecurityGroup(),
//"azurerm_network_security_rule": resourceArmNetworkSecurityRule(), "azurerm_network_security_rule": resourceArmNetworkSecurityRule(),
"azurerm_public_ip": resourceArmPublicIp(), "azurerm_public_ip": resourceArmPublicIp(),
"azurerm_route": resourceArmRoute(), "azurerm_route": resourceArmRoute(),
"azurerm_route_table": resourceArmRouteTable(), "azurerm_route_table": resourceArmRouteTable(),
"azurerm_storage_account": resourceArmStorageAccount(), "azurerm_storage_account": resourceArmStorageAccount(),
"azurerm_storage_blob": resourceArmStorageBlob(), "azurerm_storage_blob": resourceArmStorageBlob(),
"azurerm_storage_container": resourceArmStorageContainer(), "azurerm_storage_container": resourceArmStorageContainer(),
"azurerm_storage_queue": resourceArmStorageQueue(), "azurerm_storage_queue": resourceArmStorageQueue(),
"azurerm_subnet": resourceArmSubnet(), "azurerm_subnet": resourceArmSubnet(),
//"azurerm_template_deployment": resourceArmTemplateDeployment(), //"azurerm_template_deployment": resourceArmTemplateDeployment(),
//"azurerm_virtual_machine": resourceArmVirtualMachine(), //"azurerm_virtual_machine": resourceArmVirtualMachine(),
"azurerm_virtual_network": resourceArmVirtualNetwork(), "azurerm_virtual_network": resourceArmVirtualNetwork(),

View File

@ -1,219 +1,204 @@
package azurerm package azurerm
//import ( import (
// "fmt" "fmt"
// "log" "net/http"
// "net/http"
// "time" "github.com/Azure/azure-sdk-for-go/arm/network"
// "github.com/hashicorp/terraform/helper/schema"
// "github.com/Azure/azure-sdk-for-go/arm/network" )
// "github.com/hashicorp/terraform/helper/resource"
// "github.com/hashicorp/terraform/helper/schema" func resourceArmNetworkSecurityRule() *schema.Resource {
//) return &schema.Resource{
// Create: resourceArmNetworkSecurityRuleCreate,
//func resourceArmNetworkSecurityRule() *schema.Resource { Read: resourceArmNetworkSecurityRuleRead,
// return &schema.Resource{ Update: resourceArmNetworkSecurityRuleCreate,
// Create: resourceArmNetworkSecurityRuleCreate, Delete: resourceArmNetworkSecurityRuleDelete,
// Read: resourceArmNetworkSecurityRuleRead,
// Update: resourceArmNetworkSecurityRuleCreate, Schema: map[string]*schema.Schema{
// Delete: resourceArmNetworkSecurityRuleDelete, "name": {
// Type: schema.TypeString,
// Schema: map[string]*schema.Schema{ Required: true,
// "name": &schema.Schema{ ForceNew: true,
// Type: schema.TypeString, },
// Required: true,
// ForceNew: true, "resource_group_name": {
// }, Type: schema.TypeString,
// Required: true,
// "resource_group_name": &schema.Schema{ ForceNew: true,
// Type: schema.TypeString, },
// Required: true,
// ForceNew: true, "network_security_group_name": {
// }, Type: schema.TypeString,
// Required: true,
// "network_security_group_name": &schema.Schema{ },
// Type: schema.TypeString,
// Required: true, "description": {
// }, Type: schema.TypeString,
// Optional: true,
// "description": &schema.Schema{ ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
// Type: schema.TypeString, value := v.(string)
// Optional: true, if len(value) > 140 {
// ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { errors = append(errors, fmt.Errorf(
// value := v.(string) "The network security rule description can be no longer than 140 chars"))
// if len(value) > 140 { }
// errors = append(errors, fmt.Errorf( return
// "The network security rule description can be no longer than 140 chars")) },
// } },
// return
// }, "protocol": {
// }, Type: schema.TypeString,
// Required: true,
// "protocol": &schema.Schema{ ValidateFunc: validateNetworkSecurityRuleProtocol,
// Type: schema.TypeString, },
// Required: true,
// ValidateFunc: validateNetworkSecurityRuleProtocol, "source_port_range": {
// }, Type: schema.TypeString,
// Required: true,
// "source_port_range": &schema.Schema{ },
// Type: schema.TypeString,
// Required: true, "destination_port_range": {
// }, Type: schema.TypeString,
// Required: true,
// "destination_port_range": &schema.Schema{ },
// Type: schema.TypeString,
// Required: true, "source_address_prefix": {
// }, Type: schema.TypeString,
// Required: true,
// "source_address_prefix": &schema.Schema{ },
// Type: schema.TypeString,
// Required: true, "destination_address_prefix": {
// }, Type: schema.TypeString,
// Required: true,
// "destination_address_prefix": &schema.Schema{ },
// Type: schema.TypeString,
// Required: true, "access": {
// }, Type: schema.TypeString,
// Required: true,
// "access": &schema.Schema{ ValidateFunc: validateNetworkSecurityRuleAccess,
// Type: schema.TypeString, },
// Required: true,
// ValidateFunc: validateNetworkSecurityRuleAccess, "priority": {
// }, Type: schema.TypeInt,
// Required: true,
// "priority": &schema.Schema{ ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
// Type: schema.TypeInt, value := v.(int)
// Required: true, if value < 100 || value > 4096 {
// ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { errors = append(errors, fmt.Errorf(
// value := v.(int) "The `priority` can only be between 100 and 4096"))
// if value < 100 || value > 4096 { }
// errors = append(errors, fmt.Errorf( return
// "The `priority` can only be between 100 and 4096")) },
// } },
// return
// }, "direction": {
// }, Type: schema.TypeString,
// Required: true,
// "direction": &schema.Schema{ ValidateFunc: validateNetworkSecurityRuleDirection,
// Type: schema.TypeString, },
// Required: true, },
// ValidateFunc: validateNetworkSecurityRuleDirection, }
// }, }
// },
// } func resourceArmNetworkSecurityRuleCreate(d *schema.ResourceData, meta interface{}) error {
//} client := meta.(*ArmClient)
// secClient := client.secRuleClient
//func resourceArmNetworkSecurityRuleCreate(d *schema.ResourceData, meta interface{}) error {
// client := meta.(*ArmClient) name := d.Get("name").(string)
// secClient := client.secRuleClient nsgName := d.Get("network_security_group_name").(string)
// resGroup := d.Get("resource_group_name").(string)
// name := d.Get("name").(string)
// nsgName := d.Get("network_security_group_name").(string) source_port_range := d.Get("source_port_range").(string)
// resGroup := d.Get("resource_group_name").(string) destination_port_range := d.Get("destination_port_range").(string)
// source_address_prefix := d.Get("source_address_prefix").(string)
// source_port_range := d.Get("source_port_range").(string) destination_address_prefix := d.Get("destination_address_prefix").(string)
// destination_port_range := d.Get("destination_port_range").(string) priority := int32(d.Get("priority").(int))
// source_address_prefix := d.Get("source_address_prefix").(string) access := d.Get("access").(string)
// destination_address_prefix := d.Get("destination_address_prefix").(string) direction := d.Get("direction").(string)
// priority := d.Get("priority").(int) protocol := d.Get("protocol").(string)
// access := d.Get("access").(string)
// direction := d.Get("direction").(string) armMutexKV.Lock(nsgName)
// protocol := d.Get("protocol").(string) defer armMutexKV.Unlock(nsgName)
//
// armMutexKV.Lock(nsgName) properties := network.SecurityRulePropertiesFormat{
// defer armMutexKV.Unlock(nsgName) SourcePortRange: &source_port_range,
// DestinationPortRange: &destination_port_range,
// properties := network.SecurityRulePropertiesFormat{ SourceAddressPrefix: &source_address_prefix,
// SourcePortRange: &source_port_range, DestinationAddressPrefix: &destination_address_prefix,
// DestinationPortRange: &destination_port_range, Priority: &priority,
// SourceAddressPrefix: &source_address_prefix, Access: network.SecurityRuleAccess(access),
// DestinationAddressPrefix: &destination_address_prefix, Direction: network.SecurityRuleDirection(direction),
// Priority: &priority, Protocol: network.SecurityRuleProtocol(protocol),
// Access: network.SecurityRuleAccess(access), }
// Direction: network.SecurityRuleDirection(direction),
// Protocol: network.SecurityRuleProtocol(protocol), if v, ok := d.GetOk("description"); ok {
// } description := v.(string)
// properties.Description = &description
// if v, ok := d.GetOk("description"); ok { }
// description := v.(string)
// properties.Description = &description sgr := network.SecurityRule{
// } Name: &name,
// Properties: &properties,
// sgr := network.SecurityRule{ }
// Name: &name,
// Properties: &properties, _, err := secClient.CreateOrUpdate(resGroup, nsgName, name, sgr, make(chan struct{}))
// } if err != nil {
// return err
// resp, err := secClient.CreateOrUpdate(resGroup, nsgName, name, sgr) }
// if err != nil {
// return err read, err := secClient.Get(resGroup, nsgName, name)
// } if err != nil {
// d.SetId(*resp.ID) return err
// }
// log.Printf("[DEBUG] Waiting for Network Security Rule (%s) to become available", name) if read.ID == nil {
// stateConf := &resource.StateChangeConf{ return fmt.Errorf("Cannot read Security Group Rule %s/%s (resource group %s) ID",
// Pending: []string{"Accepted", "Updating"}, nsgName, name, resGroup)
// Target: []string{"Succeeded"}, }
// Refresh: securityRuleStateRefreshFunc(client, resGroup, nsgName, name),
// Timeout: 10 * time.Minute, d.SetId(*read.ID)
// }
// if _, err := stateConf.WaitForState(); err != nil { return resourceArmNetworkSecurityRuleRead(d, meta)
// return fmt.Errorf("Error waiting for Network Securty Rule (%s) to become available: %s", name, err) }
// }
// func resourceArmNetworkSecurityRuleRead(d *schema.ResourceData, meta interface{}) error {
// return resourceArmNetworkSecurityRuleRead(d, meta) secRuleClient := meta.(*ArmClient).secRuleClient
//}
// id, err := parseAzureResourceID(d.Id())
//func resourceArmNetworkSecurityRuleRead(d *schema.ResourceData, meta interface{}) error { if err != nil {
// secRuleClient := meta.(*ArmClient).secRuleClient return err
// }
// id, err := parseAzureResourceID(d.Id()) resGroup := id.ResourceGroup
// if err != nil { networkSGName := id.Path["networkSecurityGroups"]
// return err sgRuleName := id.Path["securityRules"]
// }
// resGroup := id.ResourceGroup resp, err := secRuleClient.Get(resGroup, networkSGName, sgRuleName)
// networkSGName := id.Path["networkSecurityGroups"] if resp.StatusCode == http.StatusNotFound {
// sgRuleName := id.Path["securityRules"] d.SetId("")
// return nil
// resp, err := secRuleClient.Get(resGroup, networkSGName, sgRuleName) }
// if resp.StatusCode == http.StatusNotFound { if err != nil {
// d.SetId("") return fmt.Errorf("Error making Read request on Azure Network Security Rule %s: %s", sgRuleName, err)
// return nil }
// }
// if err != nil { return nil
// return fmt.Errorf("Error making Read request on Azure Network Security Rule %s: %s", sgRuleName, err) }
// }
// func resourceArmNetworkSecurityRuleDelete(d *schema.ResourceData, meta interface{}) error {
// return nil client := meta.(*ArmClient)
//} secRuleClient := client.secRuleClient
//
//func resourceArmNetworkSecurityRuleDelete(d *schema.ResourceData, meta interface{}) error { id, err := parseAzureResourceID(d.Id())
// client := meta.(*ArmClient) if err != nil {
// secRuleClient := client.secRuleClient return err
// }
// id, err := parseAzureResourceID(d.Id()) resGroup := id.ResourceGroup
// if err != nil { nsgName := id.Path["networkSecurityGroups"]
// return err sgRuleName := id.Path["securityRules"]
// }
// resGroup := id.ResourceGroup armMutexKV.Lock(nsgName)
// nsgName := id.Path["networkSecurityGroups"] defer armMutexKV.Unlock(nsgName)
// sgRuleName := id.Path["securityRules"]
// _, err = secRuleClient.Delete(resGroup, nsgName, sgRuleName, make(chan struct{}))
// armMutexKV.Lock(nsgName)
// defer armMutexKV.Unlock(nsgName) return err
// }
// _, err = secRuleClient.Delete(resGroup, nsgName, sgRuleName)
//
// return err
//}
//
//func securityRuleStateRefreshFunc(client *ArmClient, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) resource.StateRefreshFunc {
// return func() (interface{}, string, error) {
// res, err := client.secRuleClient.Get(resourceGroupName, networkSecurityGroupName, securityRuleName)
// if err != nil {
// return nil, "", fmt.Errorf("Error issuing read request in securityGroupStateRefreshFunc to Azure ARM for network security rule '%s' (RG: '%s') (NSG: '%s'): %s", securityRuleName, resourceGroupName, networkSecurityGroupName, err)
// }
//
// return res, *res.Properties.ProvisioningState, nil
// }
//}

View File

@ -1,203 +1,203 @@
package azurerm package azurerm
//import ( import (
// "fmt" "fmt"
// "net/http" "net/http"
// "testing" "testing"
//
// "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
// "github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
//) )
//
//func TestAccAzureRMNetworkSecurityRule_basic(t *testing.T) { func TestAccAzureRMNetworkSecurityRule_basic(t *testing.T) {
//
// resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
// PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
// Providers: testAccProviders, Providers: testAccProviders,
// CheckDestroy: testCheckAzureRMNetworkSecurityRuleDestroy, CheckDestroy: testCheckAzureRMNetworkSecurityRuleDestroy,
// Steps: []resource.TestStep{ Steps: []resource.TestStep{
// resource.TestStep{ {
// Config: testAccAzureRMNetworkSecurityRule_basic, Config: testAccAzureRMNetworkSecurityRule_basic,
// Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
// testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test"), testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test"),
// ), ),
// }, },
// }, },
// }) })
//} }
//
//func TestAccAzureRMNetworkSecurityRule_addingRules(t *testing.T) { func TestAccAzureRMNetworkSecurityRule_addingRules(t *testing.T) {
//
// resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
// PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
// Providers: testAccProviders, Providers: testAccProviders,
// CheckDestroy: testCheckAzureRMNetworkSecurityRuleDestroy, CheckDestroy: testCheckAzureRMNetworkSecurityRuleDestroy,
// Steps: []resource.TestStep{ Steps: []resource.TestStep{
// resource.TestStep{ {
// Config: testAccAzureRMNetworkSecurityRule_updateBasic, Config: testAccAzureRMNetworkSecurityRule_updateBasic,
// Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
// testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test1"), testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test1"),
// ), ),
// }, },
//
// resource.TestStep{ {
// Config: testAccAzureRMNetworkSecurityRule_updateExtraRule, Config: testAccAzureRMNetworkSecurityRule_updateExtraRule,
// Check: resource.ComposeTestCheckFunc( Check: resource.ComposeTestCheckFunc(
// testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test2"), testCheckAzureRMNetworkSecurityRuleExists("azurerm_network_security_rule.test2"),
// ), ),
// }, },
// }, },
// }) })
//} }
//
//func testCheckAzureRMNetworkSecurityRuleExists(name string) resource.TestCheckFunc { func testCheckAzureRMNetworkSecurityRuleExists(name string) resource.TestCheckFunc {
// return func(s *terraform.State) error { return func(s *terraform.State) error {
//
// rs, ok := s.RootModule().Resources[name] rs, ok := s.RootModule().Resources[name]
// if !ok { if !ok {
// return fmt.Errorf("Not found: %s", name) return fmt.Errorf("Not found: %s", name)
// } }
//
// sgName := rs.Primary.Attributes["network_security_group_name"] sgName := rs.Primary.Attributes["network_security_group_name"]
// sgrName := rs.Primary.Attributes["name"] sgrName := rs.Primary.Attributes["name"]
// resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"]
// if !hasResourceGroup { if !hasResourceGroup {
// return fmt.Errorf("Bad: no resource group found in state for network security rule: %s", sgName) return fmt.Errorf("Bad: no resource group found in state for network security rule: %s", sgName)
// } }
//
// conn := testAccProvider.Meta().(*ArmClient).secRuleClient conn := testAccProvider.Meta().(*ArmClient).secRuleClient
//
// resp, err := conn.Get(resourceGroup, sgName, sgrName) resp, err := conn.Get(resourceGroup, sgName, sgrName)
// if err != nil { if err != nil {
// return fmt.Errorf("Bad: Get on secRuleClient: %s", err) return fmt.Errorf("Bad: Get on secRuleClient: %s", err)
// } }
//
// if resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusNotFound {
// return fmt.Errorf("Bad: Network Security Rule %q (resource group: %q) (network security group: %q) does not exist", sgrName, sgName, resourceGroup) return fmt.Errorf("Bad: Network Security Rule %q (resource group: %q) (network security group: %q) does not exist", sgrName, sgName, resourceGroup)
// } }
//
// return nil return nil
// } }
//} }
//
//func testCheckAzureRMNetworkSecurityRuleDestroy(s *terraform.State) error { func testCheckAzureRMNetworkSecurityRuleDestroy(s *terraform.State) error {
// conn := testAccProvider.Meta().(*ArmClient).secRuleClient conn := testAccProvider.Meta().(*ArmClient).secRuleClient
//
// for _, rs := range s.RootModule().Resources { for _, rs := range s.RootModule().Resources {
//
// if rs.Type != "azurerm_network_security_rule" { if rs.Type != "azurerm_network_security_rule" {
// continue continue
// } }
//
// sgName := rs.Primary.Attributes["network_security_group_name"] sgName := rs.Primary.Attributes["network_security_group_name"]
// sgrName := rs.Primary.Attributes["name"] sgrName := rs.Primary.Attributes["name"]
// resourceGroup := rs.Primary.Attributes["resource_group_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"]
//
// resp, err := conn.Get(resourceGroup, sgName, sgrName) resp, err := conn.Get(resourceGroup, sgName, sgrName)
//
// if err != nil { if err != nil {
// return nil return nil
// } }
//
// if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
// return fmt.Errorf("Network Security Rule still exists:\n%#v", resp.Properties) return fmt.Errorf("Network Security Rule still exists:\n%#v", resp.Properties)
// } }
// } }
//
// return nil return nil
//} }
//
//var testAccAzureRMNetworkSecurityRule_basic = ` var testAccAzureRMNetworkSecurityRule_basic = `
//resource "azurerm_resource_group" "test" { resource "azurerm_resource_group" "test" {
// name = "acceptanceTestResourceGroup1" name = "acceptanceTestResourceGroup1"
// location = "West US" location = "West US"
//} }
//
//resource "azurerm_network_security_group" "test" { resource "azurerm_network_security_group" "test" {
// name = "acceptanceTestSecurityGroup1" name = "acceptanceTestSecurityGroup1"
// location = "West US" location = "West US"
// resource_group_name = "${azurerm_resource_group.test.name}" resource_group_name = "${azurerm_resource_group.test.name}"
//} }
//
//resource "azurerm_network_security_rule" "test" { resource "azurerm_network_security_rule" "test" {
// name = "test123" name = "test123"
// priority = 100 priority = 100
// direction = "Outbound" direction = "Outbound"
// access = "Allow" access = "Allow"
// protocol = "Tcp" protocol = "Tcp"
// source_port_range = "*" source_port_range = "*"
// destination_port_range = "*" destination_port_range = "*"
// source_address_prefix = "*" source_address_prefix = "*"
// destination_address_prefix = "*" destination_address_prefix = "*"
// resource_group_name = "${azurerm_resource_group.test.name}" resource_group_name = "${azurerm_resource_group.test.name}"
// network_security_group_name = "${azurerm_network_security_group.test.name}" network_security_group_name = "${azurerm_network_security_group.test.name}"
//} }
//` `
//
//var testAccAzureRMNetworkSecurityRule_updateBasic = ` var testAccAzureRMNetworkSecurityRule_updateBasic = `
//resource "azurerm_resource_group" "test1" { resource "azurerm_resource_group" "test1" {
// name = "acceptanceTestResourceGroup2" name = "acceptanceTestResourceGroup2"
// location = "West US" location = "West US"
//} }
//
//resource "azurerm_network_security_group" "test1" { resource "azurerm_network_security_group" "test1" {
// name = "acceptanceTestSecurityGroup2" name = "acceptanceTestSecurityGroup2"
// location = "West US" location = "West US"
// resource_group_name = "${azurerm_resource_group.test1.name}" resource_group_name = "${azurerm_resource_group.test1.name}"
//} }
//
//resource "azurerm_network_security_rule" "test1" { resource "azurerm_network_security_rule" "test1" {
// name = "test123" name = "test123"
// priority = 100 priority = 100
// direction = "Outbound" direction = "Outbound"
// access = "Allow" access = "Allow"
// protocol = "Tcp" protocol = "Tcp"
// source_port_range = "*" source_port_range = "*"
// destination_port_range = "*" destination_port_range = "*"
// source_address_prefix = "*" source_address_prefix = "*"
// destination_address_prefix = "*" destination_address_prefix = "*"
// resource_group_name = "${azurerm_resource_group.test1.name}" resource_group_name = "${azurerm_resource_group.test1.name}"
// network_security_group_name = "${azurerm_network_security_group.test1.name}" network_security_group_name = "${azurerm_network_security_group.test1.name}"
//} }
//` `
//
//var testAccAzureRMNetworkSecurityRule_updateExtraRule = ` var testAccAzureRMNetworkSecurityRule_updateExtraRule = `
//resource "azurerm_resource_group" "test1" { resource "azurerm_resource_group" "test1" {
// name = "acceptanceTestResourceGroup2" name = "acceptanceTestResourceGroup2"
// location = "West US" location = "West US"
//} }
//
//resource "azurerm_network_security_group" "test1" { resource "azurerm_network_security_group" "test1" {
// name = "acceptanceTestSecurityGroup2" name = "acceptanceTestSecurityGroup2"
// location = "West US" location = "West US"
// resource_group_name = "${azurerm_resource_group.test1.name}" resource_group_name = "${azurerm_resource_group.test1.name}"
//} }
//
//resource "azurerm_network_security_rule" "test1" { resource "azurerm_network_security_rule" "test1" {
// name = "test123" name = "test123"
// priority = 100 priority = 100
// direction = "Outbound" direction = "Outbound"
// access = "Allow" access = "Allow"
// protocol = "Tcp" protocol = "Tcp"
// source_port_range = "*" source_port_range = "*"
// destination_port_range = "*" destination_port_range = "*"
// source_address_prefix = "*" source_address_prefix = "*"
// destination_address_prefix = "*" destination_address_prefix = "*"
// resource_group_name = "${azurerm_resource_group.test1.name}" resource_group_name = "${azurerm_resource_group.test1.name}"
// network_security_group_name = "${azurerm_network_security_group.test1.name}" network_security_group_name = "${azurerm_network_security_group.test1.name}"
//} }
//
//resource "azurerm_network_security_rule" "test2" { resource "azurerm_network_security_rule" "test2" {
// name = "testing456" name = "testing456"
// priority = 101 priority = 101
// direction = "Inbound" direction = "Inbound"
// access = "Deny" access = "Deny"
// protocol = "Tcp" protocol = "Tcp"
// source_port_range = "*" source_port_range = "*"
// destination_port_range = "*" destination_port_range = "*"
// source_address_prefix = "*" source_address_prefix = "*"
// destination_address_prefix = "*" destination_address_prefix = "*"
// resource_group_name = "${azurerm_resource_group.test1.name}" resource_group_name = "${azurerm_resource_group.test1.name}"
// network_security_group_name = "${azurerm_network_security_group.test1.name}" network_security_group_name = "${azurerm_network_security_group.test1.name}"
//} }
//` `