Skip to content

Commit

Permalink
Add network interface and security group association
Browse files Browse the repository at this point in the history
  • Loading branch information
sdowsland authored Feb 24, 2020
1 parent 6d87e7a commit fc5f56c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/virtual-machines/linux/public-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ resource "azurerm_network_interface" "internal" {
name = "${var.prefix}-nic2"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
network_security_group_id = azurerm_network_security_group.webserver.id

ip_configuration {
name = "internal"
Expand All @@ -71,6 +70,11 @@ resource "azurerm_network_security_group" "webserver" {
}
}

resource "azurerm_network_interface_security_group_association" "main" {
network_interface_id = azurerm_network_interface.internal.id
network_security_group_id = azurerm_network_security_group.webserver.id
}

resource "azurerm_linux_virtual_machine" "main" {
name = "${var.prefix}-vm"
resource_group_name = azurerm_resource_group.main.name
Expand Down

0 comments on commit fc5f56c

Please sign in to comment.