Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation for Terraform All-in-One deployment #157

Merged
merged 14 commits into from
Dec 20, 2024
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
variable "location" {
type = string
default = "eastus"
}

variable "rgHubName" {
type = string
default = "AksTerra-AVM-Hub-RG"
}

variable "nsgDefaultName" {
variable "nsgHubDefaultName" {
type = string
default = "nsg-default"
}
Expand Down Expand Up @@ -52,7 +57,7 @@ variable "availabilityZones" {
default = ["1", "2", "3"]
}

variable "rtName" {
variable "rtHubName" {
type = string
default = "rt-hub-table"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "naming" {

# rg is required for resource modules
resource "azurerm_resource_group" "rg" {
location = "eastus" ##module.regions.regions[random_integer.region_index.result].name
location = var.location
name = var.rgHubName
}

Expand Down Expand Up @@ -41,7 +41,7 @@ locals {
module "avm-nsg-default" {
source = "Azure/avm-res-network-networksecuritygroup/azurerm"
version = "0.2.0"
name = var.nsgDefaultName
name = var.nsgHubDefaultName
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
}
Expand Down Expand Up @@ -79,7 +79,6 @@ module "avm-res-network-virtualnetwork" {
AzureFirewallSubnet = {
name = "AzureFirewallSubnet"
address_prefixes = [var.snetFirewallAddr]

}
AzureBastionSubnet = {
name = "AzureBastionSubnet"
Expand Down Expand Up @@ -319,7 +318,7 @@ module "avm-res-network-routetable" {
source = "Azure/avm-res-network-routetable/azurerm"
version = "0.2.0"
resource_group_name = azurerm_resource_group.rg.name
name = var.rtName
name = var.rtHubName
location = azurerm_resource_group.rg.location

routes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vnetHubName" {
value = module.avm-res-network-virtualnetwork.name
}

output "rgHubName" {
value = azurerm_resource_group.rg.name
}

output "vnetHubId" {
value = module.avm-res-network-virtualnetwork.resource_id
}

output "firewallPrivateIp" {
value = module.avm-res-network-azurefirewall.resource.ip_configuration.0.private_ip_address
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you haven't yet, clone the repo and cd to the appropriate folder

```bash
git clone https://github.com/Azure/AKS-Landing-Zone-Accelerator
cd ./Scenarios/AKS-Secure-Baseline-PrivateCluster/Terraform/02-EID
cd ./Scenarios/AKS-Secure-Baseline-PrivateCluster/Terraform/03-network-hub.md
```

The following will be created:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
variable "rgLzName" {
type = string
default = "AksTerra-AVM-LZ-RG"
}

variable "location" {
type = string
default = "eastus"
}

variable "rgLzName" {
type = string
default = "AksTerra-AVM-LZ-RG"
}

variable "rgHubName" {
type = string
default = "AksTerra-AVM-Hub-RG"
Expand All @@ -18,30 +18,46 @@ variable "vnetHubName" {
default = "vnet-hub"
}

variable "vnetHubId" {
type = string
default = ""
description = "Should be value from output of 03-Network-Hub. Used only when deploying All-in-One scenario."
}

variable "firewallPrivateIp" {
type = string
default = ""
description = "Should be value from output of 03-Network-Hub. Used only when deploying All-in-One scenario."
}

variable "deployingAllInOne" {
type = bool
default = false
}

variable "vnetLzName" {
type = string
default = "vnet-lz"
}
variable "rtName" {

variable "rtLzName" {
type = string
default = "rt-lz-table"

}
variable "nsgDefaultName" {

variable "nsgLzDefaultName" {
type = string
default = "nsg-default"

}

variable "nsgAppGWName" {
type = string
default = "nsg-appgw"

}

variable "spokeVNETaddPrefixes" {
type = string
default = "10.1.0.0/16"

}

variable "snetDefaultAddr" {
Expand All @@ -52,29 +68,24 @@ variable "snetDefaultAddr" {
variable "snetAksAddr" {
type = string
default = "10.1.1.0/26"

}

variable "snetAppGWAddr" {
type = string
default = "10.1.2.0/27"

}

variable "snetVMAddr" {
type = string
default = "10.1.3.0/27"

}

variable "snetServicePeAddr" {
type = string
default = "10.1.4.0/27"

}

variable "routeAddr" {
type = string
default = "0.0.0.0/0"

}
Loading
Loading