Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
fix(module/vmseries): Reuse of existing public IP for 1 NIC caused cr…
Browse files Browse the repository at this point in the history
…eating ephemeral IPs for other NICs (#232)
  • Loading branch information
sebastianczech authored Dec 19, 2023
1 parent 032c896 commit 27bcc01
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/multi_nic_common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}
1 change: 1 addition & 0 deletions examples/vmseries_ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}

Expand Down
1 change: 1 addition & 0 deletions examples/vpc_peering_common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}

Expand Down
1 change: 1 addition & 0 deletions examples/vpc_peering_common_with_autoscale/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}),
Expand Down
1 change: 1 addition & 0 deletions examples/vpc_peering_common_with_network_tags/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}

Expand Down
1 change: 1 addition & 0 deletions examples/vpc_peering_dedicated/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}]
}

Expand Down
1 change: 1 addition & 0 deletions examples/vpc_peering_dedicated_with_autoscale/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}),
Expand Down
2 changes: 1 addition & 1 deletion modules/vmseries/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

Expand Down

0 comments on commit 27bcc01

Please sign in to comment.