Skip to content

Commit 4d83599

Browse files
author
Jeremy Spencer
committed
feat: Implement VRF Advanced Support in Terraform Provider
1 parent eebfc47 commit 4d83599

19 files changed

+369
-48
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- Add `ip_ssh_bulk_mode` and `ip_ssh_bulk_mode_window_size` attributes to `iosxe_system` resource and data source
88
- Add `set_ip_next_hop_unchanged` attribute to `iosxe_route_map` resource and data source
99
- 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)
10+
- Add `route_map` attribute with required subattributes to `iosxe_bgp_l2vpn_evpn_neighbor` resource and data source
11+
- Add `import_path_selection_all` and `ipv4_unicast_aggregate_addresses.summary_only` attributes to `iosxe_bgp_address_family_ipv4_vrf` resoutces and data sources
1012

1113
## 0.9.3
1214

@@ -21,7 +23,7 @@
2123
- Add `passive_interface_disable_*` attributes to `iosxe_ospf` and `iosxe_ospf_vrf` resources and data sources
2224
- Fix issue with destroying `iosxe_interface_ethernet` resources
2325
- Change route target attributes of `iosxe_vrf` from type "List" to "Set"
24-
- Add `role_based_enforcement` attributes to `iosxe_cts`
26+
- Add `role_based_enforcement` attributes to `iosxe_cts`
2527
- Add `tftp_source_interface_*` attributes to `iosxe_system` resource and data source
2628
- Add `hash` attribute to `iosxe_crypto_pki` resource and data source
2729
- Add `snooping_information_option`, `snooping_information_option_allow_untrusted` and `snooping_information_option_format_remote_id_string` attributes to `iosxe_dhcp` resource and data source
@@ -66,7 +68,7 @@
6668
- Add `level`, `list_name`, `action_type`, `broadcast`, `group_broadcast`, `group_logger`, `group1_group`, `group2_group`, `group3_group`, `group4_group`, `name`, `default`, `none`, `start_stop_broadcast`, `start_stop_logger`, `start_stop_group1`, `start_stop_group2`, `start_stop_group3`, `start_stop_group4`, `stop_only_broadcast`, `stop_only_logger`, `stop_only_group1`, `stop_only_group2`, `stop_only_group3`, `stop_only_group4`, `wait_start_broadcast`, `wait_start_logger`, `wait_start_group1`, `wait_start_group2`, `wait_start_group3`, `wait_start_group4`, `name`, `none`, `start_stop_broadcast`, `start_stop_logger`, `start_stop_group1`, `start_stop_group2`, `start_stop_group3`, `start_stop_group4`, `stop_only_broadcast`, `stop_only_logger`, `stop_only_group1`, `stop_only_group2`, `stop_only_group3`, `stop_only_group4`, `wait_start_broadcast`, `wait_start_logger`, `wait_start_group1`, `wait_start_group2`, `wait_start_group3`, and `wait_start_group4` attributes to `iosxe_aaa_accounting` resource and data source
6769
- Add `enable_default_group1_cache`, `enable_default_group1_enable`, `enable_default_group1_group`, `enable_default_group1_line`, `enable_default_group1_none`, `enable_default_group2_cache`, `enable_default_group2_enable`, `enable_default_group2_group`, `enable_default_group2_line`, `enable_default_group2_none`, `enable_default_group3_cache`, `enable_default_group3_enable`, `enable_default_group3_group`, `enable_default_group3_line`, `enable_default_group3_none`, `enable_default_group4_cache`, `enable_default_group4_enable`, `enable_default_group4_group`, `enable_default_group4_line`, and `enable_default_group4_none` attributes to `iosxe_aaa_authentication` resource and data source
6870
- Add `level`, `list_name`, `a1_group`, `a1_local`, `a1_if_authenticated`, `a1_none`, `a1_radius`, `a1_tacacs`, `a2_group`, `a2_local`, `a2_if_authenticated`, `a2_none`, `a2_radius`, `a2_tacacs`, `a3_group`, `a3_local`, `a3_if_authenticated`, `a3_none`, `a3_radius`, `a3_tacacs`, `a4_group`, `a4_local`, `a4_if_authenticated`, `a4_none`, `a4_radius`, `a4_tacacs`, `name`, `group1_cache`, `group1_group`, `group1_radius`, and `group1_tacacs` attributes to `iosxe_aaa_authorization` resource and data source
69-
- Add `vrf`, `local_authentication_type`, `local_authorization`, and `local_auth_max_fail_attempts` attributes to `iosxe_aaa` resrouce and data source
71+
- Add `vrf`, `local_authentication_type`, `local_authorization`, and `local_auth_max_fail_attempts` attributes to `iosxe_aaa` resrouce and data source
7072
- Add `icmp_named_msg_type`, `destination_port_equal_2`, `destination_port_equal_3`, `destination_port_equal_4`, `destination_port_equal_5`, `destination_port_equal_6`, `destination_port_equal_7`, `destination_port_equal_8`, `destination_port_equal_9`, `destination_port_equal_10`, `icmp_msg_type`, and `icmp_msg_code` attributes to `iosxe_access_list_extended` resource and data source
7173
- Add `iosxe_access_list_role_based` resource and data source
7274
- Add `filter_lists_cdp` attribute to `iosxe_device_sensor` resource and data source

docs/data-sources/bgp_address_family_ipv4_vrf.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Read-Only:
4747
- `ipv4_unicast_distance_bgp_external` (Number)
4848
- `ipv4_unicast_distance_bgp_internal` (Number)
4949
- `ipv4_unicast_distance_bgp_local` (Number)
50+
- `ipv4_unicast_import_path_selection_all` (Boolean) Import all available paths
5051
- `ipv4_unicast_networks` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks))
5152
- `ipv4_unicast_networks_mask` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks_mask))
5253
- `ipv4_unicast_redistribute_connected` (Boolean) Connected
@@ -73,6 +74,7 @@ Read-Only:
7374

7475
- `ipv4_address` (String)
7576
- `ipv4_mask` (String)
77+
- `summary_only` (Boolean) Filter more specific routes from updates
7678

7779

7880
<a id="nestedatt--vrfs--ipv4_unicast_networks"></a>

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: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
2222
ipv4_unicast_advertise_l2vpn_evpn = true
2323
ipv4_unicast_redistribute_connected = true
2424
ipv4_unicast_router_id_loopback = 101
25-
ipv4_unicast_router_id_ip = "10.1.1.1"
2625
ipv4_unicast_aggregate_addresses = [
2726
{
2827
ipv4_address = "50.0.0.0"
2928
ipv4_mask = "255.255.0.0"
29+
summary_only = true
3030
}
3131
]
3232
ipv4_unicast_redistribute_static = true
@@ -52,9 +52,10 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
5252
wildcard = "0.0.0.0"
5353
}
5454
]
55-
ipv4_unicast_distance_bgp_external = 20
56-
ipv4_unicast_distance_bgp_internal = 200
57-
ipv4_unicast_distance_bgp_local = 200
55+
ipv4_unicast_distance_bgp_external = 20
56+
ipv4_unicast_distance_bgp_internal = 200
57+
ipv4_unicast_distance_bgp_local = 200
58+
ipv4_unicast_import_path_selection_all = true
5859
}
5960
]
6061
}
@@ -94,6 +95,7 @@ Optional:
9495
- `ipv4_unicast_distance_bgp_external` (Number) - Range: `1`-`255`
9596
- `ipv4_unicast_distance_bgp_internal` (Number) - Range: `1`-`255`
9697
- `ipv4_unicast_distance_bgp_local` (Number) - Range: `1`-`255`
98+
- `ipv4_unicast_import_path_selection_all` (Boolean) Import all available paths
9799
- `ipv4_unicast_networks` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks))
98100
- `ipv4_unicast_networks_mask` (Attributes List) Specify a network to announce via BGP (see [below for nested schema](#nestedatt--vrfs--ipv4_unicast_networks_mask))
99101
- `ipv4_unicast_redistribute_connected` (Boolean) Connected
@@ -124,6 +126,10 @@ Required:
124126
- `ipv4_address` (String)
125127
- `ipv4_mask` (String)
126128

129+
Optional:
130+
131+
- `summary_only` (Boolean) Filter more specific routes from updates
132+
127133

128134
<a id="nestedatt--vrfs--ipv4_unicast_networks"></a>
129135
### Nested Schema for `vrfs.ipv4_unicast_networks`

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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
77
ipv4_unicast_advertise_l2vpn_evpn = true
88
ipv4_unicast_redistribute_connected = true
99
ipv4_unicast_router_id_loopback = 101
10-
ipv4_unicast_router_id_ip = "10.1.1.1"
1110
ipv4_unicast_aggregate_addresses = [
1211
{
1312
ipv4_address = "50.0.0.0"
1413
ipv4_mask = "255.255.0.0"
14+
summary_only = true
1515
}
1616
]
1717
ipv4_unicast_redistribute_static = true
@@ -37,9 +37,10 @@ resource "iosxe_bgp_address_family_ipv4_vrf" "example" {
3737
wildcard = "0.0.0.0"
3838
}
3939
]
40-
ipv4_unicast_distance_bgp_external = 20
41-
ipv4_unicast_distance_bgp_internal = 200
42-
ipv4_unicast_distance_bgp_local = 200
40+
ipv4_unicast_distance_bgp_external = 20
41+
ipv4_unicast_distance_bgp_internal = 200
42+
ipv4_unicast_distance_bgp_local = 200
43+
ipv4_unicast_import_path_selection_all = true
4344
}
4445
]
4546
}

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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ attributes:
3030
xpath: ipv4-unicast/bgp/router-id/ip-id
3131
tf_name: ipv4_unicast_router_id_ip
3232
example: 10.1.1.1
33+
exclude_test: true
3334
- yang_name: ipv4-unicast/aggregate-address
3435
tf_name: ipv4_unicast_aggregate_addresses
3536
type: List
@@ -40,6 +41,8 @@ attributes:
4041
- yang_name: ipv4-mask
4142
id: true
4243
example: 255.255.0.0
44+
- yang_name: summary-only
45+
example: true
4346
- yang_name: ipv4-unicast/redistribute-vrf/static
4447
tf_name: ipv4_unicast_redistribute_static
4548
example: true
@@ -109,7 +112,9 @@ attributes:
109112
tf_name: ipv4_unicast_distance_bgp_internal
110113
example: 200
111114
- yang_name: ipv4-unicast/distance/bgp/local
112-
example: 200
115+
example: 200
116+
- yang_name: ipv4-unicast/import/path/selection/all
117+
example: true
113118

114119
test_prerequisites:
115120
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1

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=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)