Skip to content

Commit f6544a1

Browse files
authored
Add missing documentation for custom learned routes (#12211)
1 parent a73ae08 commit f6544a1

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

mmv1/third_party/terraform/services/compute/resource_compute_router_peer.go.tmpl

+7-7
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ IP address is provided without a subnet mask, it is interpreted as, for IPv4, a
152152
"range": {
153153
Type: schema.TypeString,
154154
Required: true,
155-
Description: `The IP range to advertise. The value must be a
155+
Description: `The IP range to learn. The value must be a
156156
CIDR-formatted string.`,
157157
},
158158
},
@@ -440,7 +440,7 @@ func resourceComputeRouterBgpPeerCreate(d *schema.ResourceData, meta interface{}
440440
} else if v, ok := d.GetOkExists("advertised_ip_ranges"); ok || !reflect.DeepEqual(v, advertisedIpRangesProp) {
441441
obj["advertisedIpRanges"] = advertisedIpRangesProp
442442
}
443-
customLearnedIpRangesProp, err := expandNestedComputeRouterBgpPeerCustomLearnedIpRanges(d.Get("custom_learned_ip_ranges"), d, config)
443+
customLearnedIpRangesProp, err := expandNestedComputeRouterBgpPeerCustomLearnedIpRanges(d.Get("custom_learned_ip_ranges"), d, config)
444444
if err != nil {
445445
return err
446446
} else if v, ok := d.GetOkExists("custom_learned_ip_ranges"); ok || !reflect.DeepEqual(v, customLearnedIpRangesProp) {
@@ -684,8 +684,8 @@ func resourceComputeRouterBgpPeerRead(d *schema.ResourceData, meta interface{})
684684
if err := d.Set("advertised_ip_ranges", flattenNestedComputeRouterBgpPeerAdvertisedIpRanges(res["advertisedIpRanges"], d, config)); err != nil {
685685
return fmt.Errorf("Error reading RouterBgpPeer: %s", err)
686686
}
687-
if err := d.Set("custom_learned_ip_ranges", flattenNestedComputeRouterBgpPeerCustomLearnedIpRanges(res["customLearnedIpRanges"], d, config)); err != nil {
688-
return fmt.Errorf("Error reading RouterBgpPeer: %s", err)
687+
if err := d.Set("custom_learned_ip_ranges", flattenNestedComputeRouterBgpPeerCustomLearnedIpRanges(res["customLearnedIpRanges"], d, config)); err != nil {
688+
return fmt.Errorf("Error reading RouterBgpPeer: %s", err)
689689
}
690690
if err := d.Set("custom_learned_route_priority", flattenNestedComputeRouterBgpPeerCustomLearnedRoutePriority(res["customLearnedRoutePriority"], d, config)); err != nil {
691691
return fmt.Errorf("Error reading RouterBgpPeer: %s", err)
@@ -793,7 +793,7 @@ func resourceComputeRouterBgpPeerUpdate(d *schema.ResourceData, meta interface{}
793793
} else if v, ok := d.GetOkExists("advertised_ip_ranges"); ok || !reflect.DeepEqual(v, advertisedIpRangesProp) {
794794
obj["advertisedIpRanges"] = advertisedIpRangesProp
795795
}
796-
customLearnedIpRangesProp, err := expandNestedComputeRouterBgpPeerCustomLearnedIpRanges(d.Get("custom_learned_ip_ranges"), d, config)
796+
customLearnedIpRangesProp, err := expandNestedComputeRouterBgpPeerCustomLearnedIpRanges(d.Get("custom_learned_ip_ranges"), d, config)
797797
if err != nil {
798798
return err
799799
} else if v, ok := d.GetOkExists("custom_learned_ip_ranges"); ok || !reflect.DeepEqual(v, customLearnedIpRangesProp) {
@@ -1285,7 +1285,7 @@ func flattenNestedComputeRouterBgpPeerPeerIpv4NexthopAddress(v interface{}, d *s
12851285
return v
12861286
}
12871287

1288-
{{ if ne $.TargetVersionName `ga` -}}
1288+
{{- if ne $.TargetVersionName `ga` }}
12891289
func flattenNestedComputeRouterBgpPeerExportPolicies(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
12901290
return v
12911291
}
@@ -1524,7 +1524,7 @@ func expandNestedComputeRouterBgpPeerPeerIpv4NexthopAddress(v interface{}, d tpg
15241524
return v, nil
15251525
}
15261526

1527-
{{ if ne $.TargetVersionName `ga` -}}
1527+
{{- if ne $.TargetVersionName `ga` }}
15281528
func expandNestedComputeRouterBgpPeerExportPolicies(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
15291529
return v, nil
15301530
}

mmv1/third_party/terraform/website/docs/r/compute_router_peer.html.markdown

+21
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,20 @@ The following arguments are supported:
413413
Leave this field blank to advertise no custom IP ranges.
414414
Structure is [documented below](#nested_advertised_ip_ranges).
415415

416+
* `custom_learned_route_priority` -
417+
(Optional)
418+
The user-defined custom learned route priority for a BGP session.
419+
This value is applied to all custom learned route ranges for the session.
420+
You can choose a value from 0 to 65335. If you don't provide a value,
421+
Google Cloud assigns a priority of 100 to the ranges.
422+
423+
* `custom_learned_ip_ranges` -
424+
(Optional)
425+
The custom learned route IP address range. Must be a valid CIDR-formatted prefix.
426+
If an IP address is provided without a subnet mask, it is interpreted as, for IPv4,
427+
a /32 singular IP address range, and, for IPv6, /128.
428+
Structure is [documented below](#nested_custom_learned_ip_ranges).
429+
416430
* `bfd` -
417431
(Optional)
418432
BFD configuration for the BGP peering.
@@ -494,6 +508,13 @@ The following arguments are supported:
494508
(Optional)
495509
User-specified description for the IP range.
496510

511+
<a name="nested_custom_learned_ip_ranges"></a>The `custom_learned_ip_ranges` block supports:
512+
513+
* `range` -
514+
(Required)
515+
The IP range to learn. The value must be a
516+
CIDR-formatted string.
517+
497518
<a name="nested_bfd"></a>The `bfd` block supports:
498519

499520
* `session_initialization_mode` -

0 commit comments

Comments
 (0)