Skip to content

Commit 2f9e937

Browse files
author
Jeremy Spencer
committed
feat: Implement VRF Advanced Support in Terraform Provider
1 parent 6f56e6e commit 2f9e937

19 files changed

+385
-45
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
- Add `router_id_ip`, `bgp_graceful_restart`, and `bgp_update_delay` to `iosxe_bgp` resource and data source
4242
- Add `multi_area_ids` attribute to `iosxe_interface_ospf` resource and data source
4343
- Add `log_adjacency_changes`, `log_adjacency_changes_detail`, `nsf_cisco`, `nsf_cisco_enforce_global`, `nsf_ietf`, `nsf_ietf_restart_interval`, `max_metric_router_lsa_*`, `fast_reroute_per_prefix_enable_prefix_priority`, `redistribute_static_subnets` and `redistribute_connected_subnets` attributes to `iosxe_ospf` and `iosxe_ospf_vrf` resources and data sources
44+
- Enhance `set_communities` attribute documentation in `iosxe_route_map` to clarify support for well-known BGP community values (internet, local-AS, no-advertise, no-export, gshut)
45+
- Add `route_map` attribute with required subattributes to `iosxe_bgp_l2vpn_evpn_neighbor` resource and data source
46+
- Add `import_path_selection_all` and `ipv4_unicast_aggregate_addresses.summary_only` attributes to `iosxe_bgp_address_family_ipv4_vrf` resoutces and data sources
4447

4548
## 0.9.3
4649

docs/data-sources/bgp_address_family_ipv4_vrf.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ data "iosxe_bgp_address_family_ipv4_vrf" "example" {
3737
- `vrfs` (Attributes List) (see [below for nested schema](#nestedatt--vrfs))
3838

3939
<a id="nestedatt--vrfs"></a>
40+
4041
### Nested Schema for `vrfs`
4142

4243
Read-Only:
@@ -49,6 +50,7 @@ Read-Only:
4950
- `ipv4_unicast_distance_bgp_local` (Number)
5051
- `ipv4_unicast_maximum_paths_ebgp` (Number) eBGP-multipath
5152
- `ipv4_unicast_maximum_paths_ibgp` (Number)
53+
- `ipv4_unicast_import_path_selection_all` (Boolean) Import all available paths
5254
- `ipv4_unicast_networks` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks))
5355
- `ipv4_unicast_networks_mask` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks_mask))
5456
- `ipv4_unicast_redistribute_connected` (Boolean) Connected
@@ -58,6 +60,7 @@ Read-Only:
5860
- `name` (String)
5961

6062
<a id="nestedatt--vrfs--ipv4_unicast_admin_distances"></a>
63+
6164
### Nested Schema for `vrfs.ipv4_unicast_admin_distances`
6265

6366
Read-Only:
@@ -67,17 +70,18 @@ Read-Only:
6770
- `source_ip` (String)
6871
- `wildcard` (String)
6972

70-
7173
<a id="nestedatt--vrfs--ipv4_unicast_aggregate_addresses"></a>
74+
7275
### Nested Schema for `vrfs.ipv4_unicast_aggregate_addresses`
7376

7477
Read-Only:
7578

7679
- `ipv4_address` (String)
7780
- `ipv4_mask` (String)
78-
81+
- `summary_only` (Boolean) Filter more specific routes from updates
7982

8083
<a id="nestedatt--vrfs--ipv4_unicast_networks"></a>
84+
8185
### Nested Schema for `vrfs.ipv4_unicast_networks`
8286

8387
Read-Only:
@@ -87,8 +91,8 @@ Read-Only:
8791
- `network` (String)
8892
- `route_map` (String) Route-map to modify the attributes
8993

90-
9194
<a id="nestedatt--vrfs--ipv4_unicast_networks_mask"></a>
95+
9296
### Nested Schema for `vrfs.ipv4_unicast_networks_mask`
9397

9498
Read-Only:

docs/data-sources/bgp_l2vpn_evpn_neighbor.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ data "iosxe_bgp_l2vpn_evpn_neighbor" "example" {
3535

3636
- `activate` (Boolean) Enable the address family for this neighbor
3737
- `id` (String) The path of the retrieved object.
38+
- `route_map` (Attributes List) Apply route map to neighbor (see [below for nested schema](#nestedatt--route_map))
3839
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
3940
- `send_community` (String)
4041
- `soft_reconfiguration` (String) Per neighbor soft reconfiguration
42+
43+
<a id="nestedatt--route_map"></a>
44+
### Nested Schema for `route_map`
45+
46+
Read-Only:
47+
48+
- `inout` (String)
49+
- `route_map_name` (String)

docs/resources/bgp_address_family_ipv4_vrf.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
2626
{
2727
ipv4_address = "50.0.0.0"
2828
ipv4_mask = "255.255.0.0"
29+
summary_only = true
2930
}
3031
]
3132
ipv4_unicast_redistribute_static = true
@@ -56,6 +57,7 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
5657
ipv4_unicast_distance_bgp_local = 200
5758
ipv4_unicast_maximum_paths_ebgp = 2
5859
ipv4_unicast_maximum_paths_ibgp = 2
60+
ipv4_unicast_import_path_selection_all = true
5961
}
6062
]
6163
}
@@ -81,6 +83,7 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
8183
- `id` (String) The path of the object.
8284

8385
<a id="nestedatt--vrfs"></a>
86+
8487
### Nested Schema for `vrfs`
8588

8689
Required:
@@ -95,9 +98,15 @@ Optional:
9598
- `ipv4_unicast_distance_bgp_external` (Number) - Range: `1`-`255`
9699
- `ipv4_unicast_distance_bgp_internal` (Number) - Range: `1`-`255`
97100
- `ipv4_unicast_distance_bgp_local` (Number) - Range: `1`-`255`
101+
<<<<<<< HEAD
98102
- `ipv4_unicast_maximum_paths_ebgp` (Number) eBGP-multipath
99103
- Range: `1`-`32`
100104
- `ipv4_unicast_maximum_paths_ibgp` (Number) - Range: `1`-`32`
105+
=======
106+
- `ipv4_unicast_import_path_selection_all` (Boolean) Import all available paths
107+
108+
>>>>>>> 4d83599c (feat: Implement VRF Advanced Support in Terraform Provider)
109+
101110
- `ipv4_unicast_networks` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks))
102111
- `ipv4_unicast_networks_mask` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks_mask))
103112
- `ipv4_unicast_redistribute_connected` (Boolean) Connected
@@ -107,6 +116,7 @@ Optional:
107116
- Range: `0`-`2147483647`
108117

109118
<a id="nestedatt--vrfs--ipv4_unicast_admin_distances"></a>
119+
110120
### Nested Schema for `vrfs.ipv4_unicast_admin_distances`
111121

112122
Required:
@@ -119,17 +129,21 @@ Optional:
119129

120130
- `acl` (String)
121131

122-
123132
<a id="nestedatt--vrfs--ipv4_unicast_aggregate_addresses"></a>
133+
124134
### Nested Schema for `vrfs.ipv4_unicast_aggregate_addresses`
125135

126136
Required:
127137

128138
- `ipv4_address` (String)
129139
- `ipv4_mask` (String)
130140

141+
Optional:
142+
143+
- `summary_only` (Boolean) Filter more specific routes from updates
131144

132145
<a id="nestedatt--vrfs--ipv4_unicast_networks"></a>
146+
133147
### Nested Schema for `vrfs.ipv4_unicast_networks`
134148

135149
Required:
@@ -142,8 +156,8 @@ Optional:
142156
- `evpn` (Boolean) Advertise or export to EVPN address-family
143157
- `route_map` (String) Route-map to modify the attributes
144158

145-
146159
<a id="nestedatt--vrfs--ipv4_unicast_networks_mask"></a>
160+
147161
### Nested Schema for `vrfs.ipv4_unicast_networks_mask`
148162

149163
Required:

docs/resources/bgp_l2vpn_evpn_neighbor.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ resource "iosxe_bgp_l2vpn_evpn_neighbor" "example" {
2020
send_community = "both"
2121
route_reflector_client = false
2222
soft_reconfiguration = "inbound"
23+
route_map = [
24+
{
25+
inout = "in"
26+
route_map_name = "RM1"
27+
}
28+
]
2329
}
2430
```
2531

@@ -38,6 +44,7 @@ resource "iosxe_bgp_l2vpn_evpn_neighbor" "example" {
3844
- `delete_mode` (String) Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`.
3945
- Choices: `all`, `attributes`
4046
- `device` (String) A device name from the provider configuration.
47+
- `route_map` (Attributes List) Apply route map to neighbor (see [below for nested schema](#nestedatt--route_map))
4148
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
4249
- `send_community` (String) - Choices: `both`, `extended`, `standard`
4350
- `soft_reconfiguration` (String) Per neighbor soft reconfiguration
@@ -47,6 +54,14 @@ resource "iosxe_bgp_l2vpn_evpn_neighbor" "example" {
4754

4855
- `id` (String) The path of the object.
4956

57+
<a id="nestedatt--route_map"></a>
58+
### Nested Schema for `route_map`
59+
60+
Required:
61+
62+
- `inout` (String) - Choices: `in`, `out`
63+
- `route_map_name` (String)
64+
5065
## Import
5166

5267
Import is supported using the following syntax:

examples/resources/iosxe_bgp_address_family_ipv4_vrf/resource.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
1111
{
1212
ipv4_address = "50.0.0.0"
1313
ipv4_mask = "255.255.0.0"
14+
summary_only = true
1415
}
1516
]
1617
ipv4_unicast_redistribute_static = true
@@ -36,11 +37,12 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
3637
wildcard = "0.0.0.0"
3738
}
3839
]
39-
ipv4_unicast_distance_bgp_external = 20
40-
ipv4_unicast_distance_bgp_internal = 200
41-
ipv4_unicast_distance_bgp_local = 200
42-
ipv4_unicast_maximum_paths_ebgp = 2
43-
ipv4_unicast_maximum_paths_ibgp = 2
40+
ipv4_unicast_distance_bgp_external = 20
41+
ipv4_unicast_distance_bgp_internal = 200
42+
ipv4_unicast_distance_bgp_local = 200
43+
ipv4_unicast_maximum_paths_ebgp = 2
44+
ipv4_unicast_maximum_paths_ibgp = 2
45+
ipv4_unicast_import_path_selection_all = true
4446
}
4547
]
4648
}

examples/resources/iosxe_bgp_l2vpn_evpn_neighbor/resource.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ resource "iosxe_bgp_l2vpn_evpn_neighbor" "example" {
55
send_community = "both"
66
route_reflector_client = false
77
soft_reconfiguration = "inbound"
8+
route_map = [
9+
{
10+
inout = "in"
11+
route_map_name = "RM1"
12+
}
13+
]
814
}

gen/definitions/bgp_address_family_ipv4_vrf.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ attributes:
3131
tf_name: ipv4_unicast_router_id_ip
3232
exclude_test: true
3333
example: 10.1.1.1
34+
exclude_test: true
3435
- yang_name: ipv4-unicast/aggregate-address
3536
tf_name: ipv4_unicast_aggregate_addresses
3637
type: List
@@ -41,6 +42,8 @@ attributes:
4142
- yang_name: ipv4-mask
4243
id: true
4344
example: 255.255.0.0
45+
- yang_name: summary-only
46+
example: true
4447
- yang_name: ipv4-unicast/redistribute-vrf/static
4548
tf_name: ipv4_unicast_redistribute_static
4649
example: true
@@ -118,6 +121,8 @@ attributes:
118121
tf_name: ipv4_unicast_maximum_paths_ibgp
119122
xpath: ipv4-unicast/maximum-paths/ibgp/max
120123
example: 2
124+
- yang_name: ipv4-unicast/import/path/selection/all
125+
example: true
121126
test_prerequisites:
122127
- path: /Cisco-IOS-XE-native:native/vrf/definition[name=VRF1]
123128
no_delete: true

gen/definitions/bgp_l2vpn_evpn_neighbor.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ attributes:
2323
example: false
2424
- yang_name: soft-reconfiguration
2525
example: inbound
26+
- yang_name: route-map
27+
type: List
28+
attributes:
29+
- yang_name: inout
30+
id: true
31+
example: in
32+
- yang_name: route-map-name
33+
example: RM1
2634
test_prerequisites:
2735
- path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=65000]
2836
attributes:
@@ -40,3 +48,8 @@ test_prerequisites:
4048
- name: remote-as
4149
value: 65000
4250
dependencies: [0]
51+
- path: Cisco-IOS-XE-native:native/route-map=RM1
52+
attributes:
53+
- name: name
54+
value: RM1
55+

internal/provider/data_source_iosxe_bgp_address_family_ipv4_vrf.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)