Skip to content

Commit 6ca1dbc

Browse files
committed
use default advertise mode for peers to not force them to redefine the advertised groups, fix formatting
1 parent 613764f commit 6ca1dbc

File tree

8 files changed

+18
-35
lines changed

8 files changed

+18
-35
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ module "cloud_router" {
1111
source = "terraform-google-modules/cloud-router/google"
1212
version = "~> 0.1"
1313
14-
name = "example-router"
15-
project = "<PROJECT ID>"
16-
region = "us-central1"
14+
name = "example-router"
15+
project = "<PROJECT ID>"
16+
region = "us-central1"
1717
network = "default"
1818
}
1919
```

examples/interconnect_attachment/main.tf

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ provider "google" {
2121
module "cloud_router" {
2222
source = "../../"
2323

24-
name = "example-router"
25-
project = "example-project"
24+
name = "example-router"
25+
project = "example-project"
2626
network = "default"
27-
region = "us-central1"
27+
region = "us-central1"
2828

2929
bgp = {
30-
asn = 65000
30+
asn = 65000
3131
advertised_groups = ["ALL_SUBNETS"]
3232
}
3333
}
3434

3535
module "interconnect_attachment" {
3636
source = "../../modules/interconnect_attachment"
37-
name = "example-attachment"
37+
name = "example-attachment"
3838
project = "example-project"
39-
region = "us-central1"
40-
router = module.cloud_router.router.name
39+
region = "us-central1"
40+
router = module.cloud_router.router.name
4141

4242
interconnect = "https://googleapis.com/interconnects/example-interconnect"
4343

@@ -46,9 +46,8 @@ module "interconnect_attachment" {
4646
}
4747

4848
peer = {
49-
name = "example-peer"
49+
name = "example-peer"
5050
peer_ip_address = "169.254.1.2"
51-
peer_asn = 65001
52-
advertised_groups = ["ALL_SUBNETS"]
51+
peer_asn = 65001
5352
}
5453
}

examples/nat/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ provider "google" {
2121
module "cloud_router" {
2222
source = "../../"
2323

24-
name = "example-router"
25-
project = "example-project"
24+
name = "example-router"
25+
project = "example-project"
2626
network = "default"
27-
region = "us-central1"
27+
region = "us-central1"
2828

2929
nats = [{
3030
name = "example-nat"

examples/simple/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ provider "google" {
2121
module "cloud_router" {
2222
source = "../../"
2323

24-
name = "example-router"
25-
project = "example-project"
24+
name = "example-router"
25+
project = "example-project"
2626
network = "default"
27-
region = "us-central1"
27+
region = "us-central1"
2828
}

modules/interconnect_attachment/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@ module "interface" {
4040
peer_ip_address = var.peer.peer_ip_address
4141
peer_asn = var.peer.peer_asn
4242
advertised_route_priority = lookup(var.peer, "advertised_route_priority", null)
43-
advertised_groups = var.peer.advertised_groups
4443
}]
4544
}

modules/interconnect_attachment/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ variable "interface" {
8383
# - peer_ip_address (string, required): IP address of the BGP interface outside Google Cloud Platform.
8484
# - peer_asn (string, required): Peer BGP Autonomous System Number (ASN).
8585
# - advertised_route_priority (number, optional): The priority of routes advertised to this BGP peer.
86-
# - advertised_groups (string, required): User-specified list of prefix groups to advertise in custom mode
8786
variable "peer" {
8887
description = "BGP Peer for this attachment."
8988
type = any

modules/interface/main.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,4 @@ resource "google_compute_router_peer" "peers" {
3838
peer_ip_address = each.value.peer_ip_address
3939
peer_asn = each.value.peer_asn
4040
advertised_route_priority = lookup(each.value, "advertised_route_priority", null)
41-
42-
advertise_mode = "CUSTOM"
43-
advertised_groups = lookup(each.value, "advertised_groups", null)
44-
dynamic "advertised_ip_ranges" {
45-
for_each = lookup(each.value, "advertised_ip_ranges", [])
46-
content {
47-
range = advertised_ip_ranges.value.range
48-
description = lookup(advertised_ip_ranges.value, "description", null)
49-
}
50-
}
5141
}

modules/interface/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ variable "interconnect_attachment" {
6060
# - peer_ip_address (string, required): IP address of the BGP interface outside Google Cloud Platform.
6161
# - peer_asn (string, required): Peer BGP Autonomous System Number (ASN).
6262
# - advertised_route_priority (number, optional): The priority of routes advertised to this BGP peer.
63-
# - advertised_groups (string, required): User-specified list of prefix groups to advertise in custom mode
64-
# - advertised_ip_ranges (list(object), optional): User-specified list of individual IP ranges to advertise.
65-
# - range (string, required): The IP range to advertise.
66-
# - description (string, optional): User-specified description for the IP range.
6763
variable "peers" {
6864
type = any
6965
description = "BGP peers for this interface."

0 commit comments

Comments
 (0)