Skip to content

Commit 895c235

Browse files
megan07modular-magician
authored andcommitted
add docs for comute router peer new fields
Signed-off-by: Modular Magician <[email protected]>
1 parent ebf4ad1 commit 895c235

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

google/resource_compute_router_peer.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func resourceComputeRouterPeerRead(d *schema.ResourceData, meta interface{}) err
243243
d.Set("peer_ip_address", peer.PeerIpAddress)
244244
d.Set("peer_asn", peer.PeerAsn)
245245
d.Set("advertised_route_priority", peer.AdvertisedRoutePriority)
246-
d.Set("advertise_mode", peer.AdvertiseMode)
246+
d.Set("advertise_mode", flattenAdvertiseMode(peer.AdvertiseMode, d))
247247
d.Set("advertised_groups", peer.AdvertisedGroups)
248248
d.Set("advertised_ip_ranges", flattenAdvertisedIpRanges(peer.AdvertisedIpRanges))
249249
d.Set("ip_address", peer.IpAddress)
@@ -390,3 +390,10 @@ func flattenAdvertisedIpRanges(ranges []*compute.RouterAdvertisedIpRange) []map[
390390
}
391391
return ls
392392
}
393+
394+
func flattenAdvertiseMode(v interface{}, d *schema.ResourceData) interface{} {
395+
if v == nil || v.(string) == "" {
396+
return "DEFAULT"
397+
}
398+
return v
399+
}

website/docs/r/compute_router_peer.html.markdown

+29
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,42 @@ The following arguments are supported:
5151
* `advertised_route_priority` - (Optional) The priority of routes advertised to this BGP peer.
5252
Changing this forces a new peer to be created.
5353

54+
* `advertise_mode` - (Optional) User-specified flag to indicate which mode to use for advertisement.
55+
Options include `DEFAULT` or `CUSTOM`.
56+
57+
* `advertised_groups` - (Optional) User-specified list of prefix groups to advertise in custom mode,
58+
which can take one of the following options:
59+
60+
`ALL_SUBNETS`: Advertises all available subnets, including peer VPC subnets.
61+
`ALL_VPC_SUBNETS`: Advertises the router's own VPC subnets.
62+
`ALL_PEER_VPC_SUBNETS`: Advertises peer subnets of the router's VPC network.
63+
64+
Note that this field can only be populated if `advertise_mode` is `CUSTOM` and overrides the list
65+
defined for the router (in the "bgp" message). These groups are advertised in addition to any
66+
specified prefixes. Leave this field blank to advertise no custom groups.
67+
68+
* `advertised_ip_ranges` - (Optional) User-specified list of individual IP ranges to advertise in
69+
custom mode. This field can only be populated if `advertise_mode` is `CUSTOM` and overrides
70+
the list defined for the router (in the "bgp" message). These IP ranges are advertised in
71+
addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
72+
5473
* `project` - (Optional) The ID of the project in which this peer's router belongs. If it
5574
is not provided, the provider project is used. Changing this forces a new peer to be created.
5675

5776
* `region` - (Optional) The region this peer's router sits in. If not specified,
5877
the project region will be used. Changing this forces a new peer to be
5978
created.
6079

80+
81+
The `advertised_ip_ranges` block supports:
82+
83+
* `description` -
84+
(Optional) User-specified description for the IP range.
85+
86+
* `range` -
87+
(Optional) The IP range to advertise. The value must be a CIDR-formatted string.
88+
89+
6190
## Attributes Reference
6291

6392
In addition to the arguments listed above, the following computed attributes are

0 commit comments

Comments
 (0)