Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docs for comute router peer new fields #1163

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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