Skip to content

Commit

Permalink
fix(modules/panorama): Use of an already reserved external IP (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: michalbil <[email protected]>
  • Loading branch information
Avinash-jayakumar and michalbil authored Feb 29, 2024
1 parent f82aa1c commit ec3eb33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/panorama/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "google_compute_address" "private" {

# Permanent public address, not ephemeral.
resource "google_compute_address" "public" {
count = var.attach_public_ip ? 1 : 0
count = var.attach_public_ip && var.public_static_ip == null ? 1 : 0

name = "${var.name}-public"
project = var.project
Expand Down Expand Up @@ -62,7 +62,7 @@ resource "google_compute_instance" "this" {
dynamic "access_config" {
for_each = var.attach_public_ip ? [""] : []
content {
nat_ip = google_compute_address.public[0].address
nat_ip = try(var.public_static_ip, google_compute_address.public[0].address)
}
}

Expand Down

0 comments on commit ec3eb33

Please sign in to comment.