@@ -6,6 +6,29 @@ resource "azurerm_virtual_network" "alz" {
66 address_space = [var . virtual_network_address_space ]
77}
88
9+ resource "azurerm_public_ip" "alz" {
10+ count = local. use_private_networking ? 1 : 0
11+ name = var. public_ip_name
12+ location = var. azure_location
13+ resource_group_name = azurerm_resource_group. network [0 ]. name
14+ allocation_method = " Static"
15+ sku = " Standard"
16+ }
17+
18+ resource "azurerm_nat_gateway" "alz" {
19+ count = local. use_private_networking ? 1 : 0
20+ name = var. nat_gateway_name
21+ location = var. azure_location
22+ resource_group_name = azurerm_resource_group. network [0 ]. name
23+ sku_name = " Standard"
24+ }
25+
26+ resource "azurerm_nat_gateway_public_ip_association" "alz" {
27+ count = local. use_private_networking ? 1 : 0
28+ nat_gateway_id = azurerm_nat_gateway. alz [0 ]. id
29+ public_ip_address_id = azurerm_public_ip. alz [0 ]. id
30+ }
31+
932resource "azurerm_subnet" "container_instances" {
1033 count = local. use_private_networking ? 1 : 0
1134 name = var. virtual_network_subnet_name_container_instances
@@ -22,6 +45,12 @@ resource "azurerm_subnet" "container_instances" {
2245 }
2346}
2447
48+ resource "azurerm_subnet_nat_gateway_association" "container_instances" {
49+ count = local. use_private_networking ? 1 : 0
50+ subnet_id = azurerm_subnet. container_instances [0 ]. id
51+ nat_gateway_id = azurerm_nat_gateway. alz [0 ]. id
52+ }
53+
2554resource "azurerm_subnet" "storage" {
2655 count = local. use_private_networking ? 1 : 0
2756 name = var. virtual_network_subnet_name_storage
0 commit comments