Skip to content

Commit

Permalink
NSG on Bastion (TF)
Browse files Browse the repository at this point in the history
  • Loading branch information
xpillons committed Mar 29, 2024
1 parent da4230a commit f8e5a65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tf/network_security_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ resource "azurerm_subnet_network_security_group_association" "netapp" {
network_security_group_id = azurerm_network_security_group.common[0].id
}

resource "azurerm_subnet_network_security_group_association" "bastion" {
count = local.create_nsg ? 1 : 0
subnet_id = local.create_bastion_subnet ? azurerm_subnet.bastion[0].id : data.azurerm_subnet.bastion[0].id
network_security_group_id = azurerm_network_security_group.common[0].id
}

resource "azurerm_subnet_network_security_group_association" "outbounddns" {
count = local.create_nsg ? (local.no_outbounddns_subnet ? 0 : 1) : 0
subnet_id = local.create_outbounddns_subnet ? azurerm_subnet.outbounddns[0].id : data.azurerm_subnet.outbounddns[0].id
Expand Down

0 comments on commit f8e5a65

Please sign in to comment.