Skip to content

Commit

Permalink
feat: bgp block can now be optional (#152)
Browse files Browse the repository at this point in the history
Co-authored-by: Tanguy NICOLAS <[email protected]>
  • Loading branch information
tanguynicolas and Tanguy NICOLAS authored Apr 25, 2024
1 parent a945830 commit 4069d68
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ resource "google_compute_router" "router" {
project = var.project_id
region = var.region
network = var.network
bgp {
asn = var.router_asn
keepalive_interval = var.router_keepalive_interval

dynamic "bgp" {
for_each = var.router_asn != null ? [{
asn = var.router_asn
keepalive_interval = var.router_keepalive_interval
}] : []
content {
asn = bgp.value.asn
keepalive_interval = bgp.value.keepalive_interval
}
}
}

Expand Down

0 comments on commit 4069d68

Please sign in to comment.