Skip to content

Commit

Permalink
add docs for comute router peer new fields
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
megan07 authored and modular-magician committed Sep 24, 2019
1 parent b18c102 commit fb26f60
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
9 changes: 8 additions & 1 deletion google-beta/resource_compute_router_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func resourceComputeRouterPeerRead(d *schema.ResourceData, meta interface{}) err
d.Set("peer_ip_address", peer.PeerIpAddress)
d.Set("peer_asn", peer.PeerAsn)
d.Set("advertised_route_priority", peer.AdvertisedRoutePriority)
d.Set("advertise_mode", peer.AdvertiseMode)
d.Set("advertise_mode", flattenAdvertiseMode(peer.AdvertiseMode, d))
d.Set("advertised_groups", peer.AdvertisedGroups)
d.Set("advertised_ip_ranges", flattenAdvertisedIpRanges(peer.AdvertisedIpRanges))
d.Set("ip_address", peer.IpAddress)
Expand Down Expand Up @@ -390,3 +390,10 @@ func flattenAdvertisedIpRanges(ranges []*compute.RouterAdvertisedIpRange) []map[
}
return ls
}

func flattenAdvertiseMode(v interface{}, d *schema.ResourceData) interface{} {
if v == nil || v.(string) == "" {
return "DEFAULT"
}
return v
}
29 changes: 29 additions & 0 deletions website/docs/r/compute_router_peer.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,42 @@ The following arguments are supported:
* `advertised_route_priority` - (Optional) The priority of routes advertised to this BGP peer.
Changing this forces a new peer to be created.

* `advertise_mode` - (Optional) User-specified flag to indicate which mode to use for advertisement.
Options include `DEFAULT` or `CUSTOM`.

* `advertised_groups` - (Optional) User-specified list of prefix groups to advertise in custom mode,
which can take one of the following options:

`ALL_SUBNETS`: Advertises all available subnets, including peer VPC subnets.
`ALL_VPC_SUBNETS`: Advertises the router's own VPC subnets.
`ALL_PEER_VPC_SUBNETS`: Advertises peer subnets of the router's VPC network.

Note that this field can only be populated if `advertise_mode` is `CUSTOM` and overrides the list
defined for the router (in the "bgp" message). These groups are advertised in addition to any
specified prefixes. Leave this field blank to advertise no custom groups.

* `advertised_ip_ranges` - (Optional) User-specified list of individual IP ranges to advertise in
custom mode. This field can only be populated if `advertise_mode` is `CUSTOM` and overrides
the list defined for the router (in the "bgp" message). These IP ranges are advertised in
addition to any specified groups. Leave this field blank to advertise no custom IP ranges.

* `project` - (Optional) The ID of the project in which this peer's router belongs. If it
is not provided, the provider project is used. Changing this forces a new peer to be created.

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


The `advertised_ip_ranges` block supports:

* `description` -
(Optional) User-specified description for the IP range.

* `range` -
(Optional) The IP range to advertise. The value must be a CIDR-formatted string.


## Attributes Reference

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

0 comments on commit fb26f60

Please sign in to comment.