Specified a variable's contents

Specified that the security group needs to be addressed by it's id and not by its name. This will assist when debugging the error with message "{name} is invalid. Expect fully qualified resource Id that start with azure .properties.networkSecurityGroup.id"
This commit is contained in:
Jacob Crowther 2016-10-13 17:20:09 -06:00 committed by GitHub
parent fecc218505
commit 90caad5166
1 changed files with 3 additions and 2 deletions

View File

@ -34,6 +34,7 @@ resource "azurerm_virtual_network" "test" {
subnet { subnet {
name = "subnet3" name = "subnet3"
address_prefix = "10.0.3.0/24" address_prefix = "10.0.3.0/24"
security_group = "${azurerm_network_security_group.test.id}"
} }
tags { tags {
@ -73,7 +74,7 @@ The `subnet` block supports:
* `address_prefix` - (Required) The address prefix to use for the subnet. * `address_prefix` - (Required) The address prefix to use for the subnet.
* `security_group` - (Optional) The Network Security Group to associate with * `security_group` - (Optional) The Network Security Group to associate with
the subnet. the subnet. (Referenced by `id`, ie. `azurerm_network_security_group.test.id`)
## Attributes Reference ## Attributes Reference
@ -88,4 +89,4 @@ Virtual Networks can be imported using the `resource id`, e.g.
``` ```
terraform import azurerm_virtual_network.testNetwork /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1 terraform import azurerm_virtual_network.testNetwork /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1
``` ```