From 97113aa3e5648411a534508b29852810839ec00e Mon Sep 17 00:00:00 2001 From: megan07 Date: Thu, 26 Sep 2019 11:05:01 +0000 Subject: [PATCH] add docs for compute router peer new fields Signed-off-by: Modular Magician --- google-beta/resource_compute_router_peer.go | 9 +++++- .../docs/r/compute_router_peer.html.markdown | 29 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/google-beta/resource_compute_router_peer.go b/google-beta/resource_compute_router_peer.go index 1df7945887..88ec144407 100644 --- a/google-beta/resource_compute_router_peer.go +++ b/google-beta/resource_compute_router_peer.go @@ -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) @@ -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 +} diff --git a/website/docs/r/compute_router_peer.html.markdown b/website/docs/r/compute_router_peer.html.markdown index 882506069e..7ffb411787 100644 --- a/website/docs/r/compute_router_peer.html.markdown +++ b/website/docs/r/compute_router_peer.html.markdown @@ -51,6 +51,25 @@ 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. @@ -58,6 +77,16 @@ The following arguments are supported: 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