diff --git a/azurerm/resource_arm_network_interface_card.go b/azurerm/resource_arm_network_interface_card.go index fb0df49b8099..19c6dad5ab15 100644 --- a/azurerm/resource_arm_network_interface_card.go +++ b/azurerm/resource_arm_network_interface_card.go @@ -324,12 +324,12 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e d.Set("network_security_group_id", resp.NetworkSecurityGroup.ID) } + d.Set("name", resp.Name) + d.Set("resource_group_name", resGroup) + d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("applied_dns_servers", appliedDNSServers) d.Set("dns_servers", dnsServers) d.Set("enable_ip_forwarding", resp.EnableIPForwarding) - d.Set("location", resp.Location) - d.Set("name", resp.Name) - d.Set("resource_group_name", resGroup) flattenAndSetTags(d, resp.Tags) diff --git a/azurerm/resource_arm_network_interface_card_test.go b/azurerm/resource_arm_network_interface_card_test.go index d7a39c6f0cf1..99af7f1ee54c 100644 --- a/azurerm/resource_arm_network_interface_card_test.go +++ b/azurerm/resource_arm_network_interface_card_test.go @@ -126,7 +126,8 @@ func TestAccAzureRMNetworkInterface_bug7986(t *testing.T) { { Config: testAccAzureRMNetworkInterface_bug7986(rInt), Check: resource.ComposeTestCheckFunc( - testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test"), + testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test1"), + testCheckAzureRMNetworkInterfaceExists("azurerm_network_interface.test2"), ), }, }, @@ -505,26 +506,28 @@ resource "azurerm_network_security_group" "test" { location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" - security_rule { - name = "test123" - priority = 100 - direction = "Inbound" - access = "Allow" - protocol = "Tcp" - source_port_range = "*" - destination_port_range = "*" - source_address_prefix = "*" - destination_address_prefix = "*" - } - tags { environment = "Production" } } -resource "azurerm_network_security_rule" "test" { - name = "test" - priority = 100 +resource "azurerm_network_security_rule" "test1" { + name = "test1" + priority = 101 + direction = "Outbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "*" + source_address_prefix = "*" + destination_address_prefix = "*" + resource_group_name = "${azurerm_resource_group.test.name}" + network_security_group_name = "${azurerm_network_security_group.test.name}" +} + +resource "azurerm_network_security_rule" "test2" { + name = "test2" + priority = 102 direction = "Outbound" access = "Allow" protocol = "Tcp" @@ -552,12 +555,6 @@ resource "azurerm_virtual_network" "test" { address_space = ["10.0.0.0/16"] resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" - - subnet { - name = "second" - address_prefix = "10.0.3.0/24" - security_group = "${azurerm_network_security_group.test.id}" - } } resource "azurerm_subnet" "test" { diff --git a/azurerm/resource_arm_subnet_test.go b/azurerm/resource_arm_subnet_test.go index 08d8582e33d0..3100f8a8e2cb 100644 --- a/azurerm/resource_arm_subnet_test.go +++ b/azurerm/resource_arm_subnet_test.go @@ -72,7 +72,8 @@ func TestAccAzureRMSubnet_bug7986(t *testing.T) { { Config: initConfig, Check: resource.ComposeTestCheckFunc( - testCheckAzureRMSubnetExists("azurerm_subnet.test"), + testCheckAzureRMSubnetExists("azurerm_subnet.first"), + testCheckAzureRMSubnetExists("azurerm_subnet.second"), ), }, }, @@ -445,7 +446,7 @@ resource "azurerm_subnet" "first" { } resource "azurerm_route_table" "second" { - name = "$acctest%d-private-2" + name = "acctest%d-private-2" location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" } @@ -459,7 +460,7 @@ resource "azurerm_route" "second" { } resource "azurerm_subnet" "second" { - name = "acctest%d-private-1" + name = "acctest%d-private-2" resource_group_name = "${azurerm_resource_group.test.name}" virtual_network_name = "${azurerm_virtual_network.test.name}" address_prefix = "10.0.1.0/24"