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

Commit

Permalink
Fix issue with reusing existing public and creating ephemeral IP addr…
Browse files Browse the repository at this point in the history
…ess for all interfaces
  • Loading branch information
sebastianczech committed Dec 18, 2023
1 parent 032c896 commit f7ffbe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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
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 f7ffbe0

Please sign in to comment.