diff --git a/examples/multi_nic_common/main.tf b/examples/multi_nic_common/main.tf index 5ee3d581..c1534ae2 100644 --- a/examples/multi_nic_common/main.tf +++ b/examples/multi_nic_common/main.tf @@ -144,6 +144,7 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } diff --git a/examples/standalone_vmseries_with_metadata_bootstrap/main.tf b/examples/standalone_vmseries_with_metadata_bootstrap/main.tf index 09b588a3..8b2a6750 100644 --- a/examples/standalone_vmseries_with_metadata_bootstrap/main.tf +++ b/examples/standalone_vmseries_with_metadata_bootstrap/main.tf @@ -43,5 +43,6 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } \ No newline at end of file diff --git a/examples/vmseries_ha/main.tf b/examples/vmseries_ha/main.tf index d1f1de4e..c0ea8664 100644 --- a/examples/vmseries_ha/main.tf +++ b/examples/vmseries_ha/main.tf @@ -148,6 +148,7 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } diff --git a/examples/vpc_peering_common/main.tf b/examples/vpc_peering_common/main.tf index 82a25ed7..185ea064 100644 --- a/examples/vpc_peering_common/main.tf +++ b/examples/vpc_peering_common/main.tf @@ -142,6 +142,7 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } diff --git a/examples/vpc_peering_common_with_autoscale/main.tf b/examples/vpc_peering_common_with_autoscale/main.tf index 1309eec1..78ecf091 100644 --- a/examples/vpc_peering_common_with_autoscale/main.tf +++ b/examples/vpc_peering_common_with_autoscale/main.tf @@ -99,6 +99,7 @@ module "autoscale" { { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] metadata = merge( try(each.value.bootstrap_options, {}), diff --git a/examples/vpc_peering_common_with_network_tags/main.tf b/examples/vpc_peering_common_with_network_tags/main.tf index 9949e157..31157fc8 100644 --- a/examples/vpc_peering_common_with_network_tags/main.tf +++ b/examples/vpc_peering_common_with_network_tags/main.tf @@ -143,6 +143,7 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } diff --git a/examples/vpc_peering_dedicated/main.tf b/examples/vpc_peering_dedicated/main.tf index 7bb254c9..f298dfc6 100644 --- a/examples/vpc_peering_dedicated/main.tf +++ b/examples/vpc_peering_dedicated/main.tf @@ -142,6 +142,7 @@ module "vmseries" { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link private_ip = v.private_ip create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] } diff --git a/examples/vpc_peering_dedicated_with_autoscale/main.tf b/examples/vpc_peering_dedicated_with_autoscale/main.tf index 1309eec1..78ecf091 100644 --- a/examples/vpc_peering_dedicated_with_autoscale/main.tf +++ b/examples/vpc_peering_dedicated_with_autoscale/main.tf @@ -99,6 +99,7 @@ module "autoscale" { { subnetwork = module.vpc[v.vpc_network_key].subnetworks[v.subnetwork_key].self_link create_public_ip = try(v.create_public_ip, false) + public_ip = try(v.public_ip, null) }] metadata = merge( try(each.value.bootstrap_options, {}), diff --git a/modules/vmseries/main.tf b/modules/vmseries/main.tf index e8ab7e1e..a5c200b5 100644 --- a/modules/vmseries/main.tf +++ b/modules/vmseries/main.tf @@ -7,7 +7,7 @@ locals { nat_ip = try(v.public_ip, google_compute_address.public[k].address, null) public_ptr_domain_name = try(v.public_ptr_domain_name, google_compute_address.public[k].public_ptr_domain_name, null) } - if can(v.public_ip) || local.create_public_ip[k] + if try(v.public_ip, null) != null || local.create_public_ip[k] } }