File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1-
21locals {
2+ network_name = var. network_name == " " ? " ${ var . cluster_name } -network" : var. network_name
33 resource_group = {
44 name = var.create_resource_group ? azurerm_resource_group.main[0 ].name : var.resource_group_name
55 location = var.location
Original file line number Diff line number Diff line change 11resource "azurerm_virtual_network" "network" {
22 address_space = var. network_cidrs
33 location = local. resource_group . location
4- name = var . network_name
4+ name = local . network_name
55 resource_group_name = local. resource_group . name
66}
77
88resource "azurerm_subnet" "network" {
99 address_prefixes = var. subnet_cidrs
10- name = " ${ var . network_name } -sn"
10+ name = " ${ local . network_name } -sn"
1111 resource_group_name = local. resource_group . name
1212 virtual_network_name = azurerm_virtual_network. network . name
1313 enforce_private_link_endpoint_network_policies = true
1414}
1515
1616resource "azurerm_subnet" "postgres" {
17- name = " ${ var . network_name } -pg"
17+ name = " ${ local . network_name } -pg"
1818 resource_group_name = local. resource_group . name
1919 virtual_network_name = azurerm_virtual_network. network . name
2020 address_prefixes = var. postgres_cidrs
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "mysql" {
3131resource "azurerm_private_dns_zone" "postgres" {
3232 count = var. create_db ? 1 : 0
3333
34- name = var . postgres_dns_zone
34+ name = local . db_name
3535 resource_group_name = local. resource_group . name
3636}
3737
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ variable "location" {
4040
4141variable "network_name" {
4242 type = string
43- default = " plural "
43+ default = " "
4444}
4545
4646variable "network_cidrs" {
You can’t perform that action at this time.
0 commit comments