Skip to content

Commit

Permalink
removing unneeded network rules (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-robertson1 authored Jun 18, 2024
1 parent 1d3224b commit d798f19
Showing 1 changed file with 1 addition and 62 deletions.
63 changes: 1 addition & 62 deletions networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,10 @@ resource "azurerm_subnet_network_security_group_association" "migration" {
network_security_group_id = azurerm_network_security_group.migration[0].id
}

resource "azurerm_network_security_rule" "allow_outbound_prddartsoracle" {
count = local.is_migration_environment ? 1 : 0
name = "allow-outbound-prddartsoracle"
priority = 100
direction = "Outbound"
access = "Allow"
protocol = "*"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "10.24.239.166"
destination_address_prefix = "*"
network_security_group_name = azurerm_network_security_group.migration[0].name
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
}


resource "azurerm_network_security_rule" "block_internet" {
count = local.is_migration_environment ? 1 : 0
name = "BlockInternet"
priority = 110
priority = 100
direction = "Outbound"
access = var.env == "prod" ? "Deny" : "Allow"
protocol = "*"
Expand All @@ -72,51 +56,6 @@ resource "azurerm_network_security_rule" "block_internet" {
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
}

resource "azurerm_network_security_rule" "allow_mgmt_traffic" {
count = local.is_migration_environment ? 1 : 0
name = "allow-mgmt-traffic"
priority = 120
direction = "Inbound"
access = "Allow"
protocol = "*"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "10.24.239.32/28"
destination_address_prefix = "10.24.239.166"
network_security_group_name = azurerm_network_security_group.migration[0].name
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
}

# resource "azurerm_network_security_rule" "deny_inbound_prddartsoracle" {
# count = local.is_migration_environment ? 1 : 0
# name = "deny-inbound-prddartsoracle"
# priority = 130
# direction = "Inbound"
# access = "Deny"
# protocol = "*"
# source_port_range = "*"
# destination_port_range = "*"
# source_address_prefix = "*"
# destination_address_prefix = "10.24.239.166"
# network_security_group_name = azurerm_network_security_group.migration[0].name
# resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
# }

resource "azurerm_network_security_rule" "deny_outbound_prddartsoracle" {
count = local.is_migration_environment ? 1 : 0
name = "deny-outbound-prddartsoracle"
priority = 140
direction = "Outbound"
access = "Deny"
protocol = "*"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "10.24.239.166"
destination_address_prefix = "*"
network_security_group_name = azurerm_network_security_group.migration[0].name
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
}

resource "azurerm_subnet" "migration-extended" {
count = local.is_migration_environment && var.extended_address_space != null ? 1 : 0
name = "migration-subnet-extended"
Expand Down

0 comments on commit d798f19

Please sign in to comment.