Skip to content

Commit c4af7df

Browse files
committed
Add various bgp attributes
1 parent 891b0ea commit c4af7df

32 files changed

+833
-67
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
- Add `v3_sha_encryption` and `v3_aes_encryption` attributes to `iosxr_snmp_server` resource and data source
88
- Add `fast_reroute_per_prefix` and `fast_reroute_per_prefix_ti_lfa` attributes to `iosxr_router_isis_interface_address_family` resource and data source
99
- Add `reuse_connection` provider attribute
10+
- Add `redistribute_connected_route_policy` and `redistribute_static_route_policy` attributes to `iosxr_router_bgp_address_family` resource and data source
11+
- Add `networks.route_policy` and `redistribute_isis.route_policy` attributes to `iosxr_router_bgp_address_family` resource and data source
12+
- Add `additional_paths`, `allocate_label` and `advertise_best_external` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
13+
- Add `redistribute_connected_route_policy` and `redistribute_static_route_policy` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
14+
- Add `networks.route_policy` and `redistribute_isis.route_policy` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
15+
- Add `route_policy_in` and `route_policy_out` attributes to `iosxr_router_bgp_neighbor_address_family` resource and data source
1016

1117
## 0.3.1
1218

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Requirements
66

77
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
8-
- [Go](https://golang.org/doc/install) >= 1.19
8+
- [Go](https://golang.org/doc/install) >= 1.20
99

1010
## Building The Provider
1111

docs/data-sources/router_bgp_address_family.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ data "iosxr_router_bgp_address_family" "example" {
5151
- `nexthop_trigger_delay_non_critical` (Number) For non-critical notification
5252
- `redistribute_connected` (Boolean) Connected routes
5353
- `redistribute_connected_metric` (Number) Metric for redistributed routes
54+
- `redistribute_connected_route_policy` (String) Route policy reference
5455
- `redistribute_isis` (Attributes List) ISO IS-IS (see [below for nested schema](#nestedatt--redistribute_isis))
5556
- `redistribute_ospf` (Attributes List) Open Shortest Path First (OSPF or OSPFv3) (see [below for nested schema](#nestedatt--redistribute_ospf))
5657
- `redistribute_static` (Boolean) Static routes
5758
- `redistribute_static_metric` (Number) Metric for redistributed routes
59+
- `redistribute_static_route_policy` (String) Route policy reference
5860

5961
<a id="nestedatt--aggregate_addresses"></a>
6062
### Nested Schema for `aggregate_addresses`
@@ -75,6 +77,7 @@ Read-Only:
7577

7678
- `address` (String) IPv6 network and mask or masklength
7779
- `masklength` (Number) Network in prefix/length format (prefix part)
80+
- `route_policy` (String) Route-policy to modify the attributes
7881

7982

8083
<a id="nestedatt--redistribute_isis"></a>
@@ -91,6 +94,7 @@ Read-Only:
9194
- `level_two` (Boolean) Redistribute ISIS level 2 ISIS routes
9295
- `level_two_one_inter_area` (Boolean) Redistribute ISIS level 1 inter-area routes
9396
- `metric` (Number) Metric for redistributed routes
97+
- `route_policy` (String) Route policy reference
9498

9599

96100
<a id="nestedatt--redistribute_ospf"></a>
@@ -105,4 +109,5 @@ Read-Only:
105109
- `match_internal_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
106110
- `match_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
107111
- `metric` (Number) Metric for redistributed routes
112+
- `route_policy` (String) Route policy reference
108113
- `router_tag` (String) Open Shortest Path First (OSPF)

docs/data-sources/router_bgp_neighbor_address_family.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ data "iosxr_router_bgp_neighbor_address_family" "example" {
4040
- `id` (String) The path of the retrieved object.
4141
- `import_stitching_rt_re_originate_stitching_rt` (Boolean) Reoriginate imported routes by attaching stitching RTs
4242
- `next_hop_self_inheritance_disable` (Boolean) Prevent next-hop-self from being inherited from the parent
43+
- `route_policy_in` (String) Apply route policy to inbound routes
44+
- `route_policy_out` (String) Apply route policy to outbound routes
4345
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
4446
- `route_reflector_client_inheritance_disable` (Boolean) Prevent route-reflector-client from being inherited from the parent

docs/data-sources/router_bgp_vrf_address_family.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ data "iosxr_router_bgp_vrf_address_family" "example" {
3535

3636
### Read-Only
3737

38+
- `additional_paths_receive` (Boolean) Additional paths Receive capability
39+
- `additional_paths_selection_route_policy` (String) Route-policy for additional paths selection
40+
- `additional_paths_send` (Boolean) Additional paths Send capability
41+
- `advertise_best_external` (Boolean) Advertise best-external path
3842
- `aggregate_addresses` (Attributes List) IPv6 Aggregate address and mask or masklength (see [below for nested schema](#nestedatt--aggregate_addresses))
43+
- `allocate_label_all` (Boolean) Allocate labels for all prefixes
44+
- `allocate_label_all_unlabeled_path` (Boolean) Allocate label for unlabeled paths too
3945
- `id` (String) The path of the retrieved object.
4046
- `label_mode_per_ce` (Boolean) Set per CE label mode
4147
- `label_mode_per_vrf` (Boolean) Set per VRF label mode
@@ -45,9 +51,11 @@ data "iosxr_router_bgp_vrf_address_family" "example" {
4551
- `networks` (Attributes List) IPv6 network and mask or masklength (see [below for nested schema](#nestedatt--networks))
4652
- `redistribute_connected` (Boolean) Connected routes
4753
- `redistribute_connected_metric` (Number) Metric for redistributed routes
54+
- `redistribute_connected_route_policy` (String) Route policy reference
4855
- `redistribute_ospf` (Attributes List) Open Shortest Path First (OSPF/OSPFv3) (see [below for nested schema](#nestedatt--redistribute_ospf))
4956
- `redistribute_static` (Boolean) Static routes
5057
- `redistribute_static_metric` (Number) Metric for redistributed routes
58+
- `redistribute_static_route_policy` (String) Route policy reference
5159
- `segment_routing_srv6_alloc_mode_per_vrf` (Boolean) Set per VRF label mode
5260
- `segment_routing_srv6_locator` (String) Specify locator
5361

@@ -70,6 +78,7 @@ Read-Only:
7078

7179
- `address` (String) IPv6 network and mask or masklength
7280
- `masklength` (Number) Network in prefix/length format (prefix part)
81+
- `route_policy` (String) Route-policy to modify the attributes
7382

7483

7584
<a id="nestedatt--redistribute_ospf"></a>
@@ -84,4 +93,5 @@ Read-Only:
8493
- `match_internal_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
8594
- `match_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
8695
- `metric` (Number) Metric for redistributed routes
96+
- `route_policy` (String) Route policy reference
8797
- `router_tag` (String) Open Shortest Path First (OSPF)

docs/guides/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ description: |-
1616
- Add `v3_sha_encryption` and `v3_aes_encryption` attributes to `iosxr_snmp_server` resource and data source
1717
- Add `fast_reroute_per_prefix` and `fast_reroute_per_prefix_ti_lfa` attributes to `iosxr_router_isis_interface_address_family` resource and data source
1818
- Add `reuse_connection` provider attribute
19+
- Add `redistribute_connected_route_policy` and `redistribute_static_route_policy` attributes to `iosxr_router_bgp_address_family` resource and data source
20+
- Add `networks.route_policy` and `redistribute_isis.route_policy` attributes to `iosxr_router_bgp_address_family` resource and data source
21+
- Add `additional_paths`, `allocate_label` and `advertise_best_external` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
22+
- Add `redistribute_connected_route_policy` and `redistribute_static_route_policy` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
23+
- Add `networks.route_policy` and `redistribute_isis.route_policy` attributes to `iosxr_router_bgp_vrf_address_family` resource and data source
24+
- Add `route_policy_in` and `route_policy_out` attributes to `iosxr_router_bgp_neighbor_address_family` resource and data source
1925

2026
## 0.3.1
2127

docs/resources/router_bgp_address_family.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ resource "iosxr_router_bgp_address_family" "example" {
2727
label_mode_per_vrf = false
2828
redistribute_connected = true
2929
redistribute_connected_metric = 10
30+
redistribute_connected_route_policy = "ROUTE_POLICY_1"
3031
redistribute_static = true
3132
redistribute_static_metric = 10
33+
redistribute_static_route_policy = "ROUTE_POLICY_1"
3234
aggregate_addresses = [
3335
{
3436
address = "10.0.0.0"
@@ -40,8 +42,9 @@ resource "iosxr_router_bgp_address_family" "example" {
4042
]
4143
networks = [
4244
{
43-
address = "10.1.0.0"
44-
masklength = 16
45+
address = "10.1.0.0"
46+
masklength = 16
47+
route_policy = "ROUTE_POLICY_1"
4548
}
4649
]
4750
redistribute_isis = [
@@ -55,6 +58,7 @@ resource "iosxr_router_bgp_address_family" "example" {
5558
level_two_one_inter_area = false
5659
level_one_inter_area = false
5760
metric = 100
61+
route_policy = "ROUTE_POLICY_1"
5862
}
5963
]
6064
redistribute_ospf = [
@@ -67,6 +71,7 @@ resource "iosxr_router_bgp_address_family" "example" {
6771
match_external_nssa_external = false
6872
match_nssa_external = false
6973
metric = 100
74+
route_policy = "ROUTE_POLICY_1"
7075
}
7176
]
7277
}
@@ -109,11 +114,13 @@ resource "iosxr_router_bgp_address_family" "example" {
109114
- `redistribute_connected` (Boolean) Connected routes
110115
- `redistribute_connected_metric` (Number) Metric for redistributed routes
111116
- Range: `0`-`4294967295`
117+
- `redistribute_connected_route_policy` (String) Route policy reference
112118
- `redistribute_isis` (Attributes List) ISO IS-IS (see [below for nested schema](#nestedatt--redistribute_isis))
113119
- `redistribute_ospf` (Attributes List) Open Shortest Path First (OSPF or OSPFv3) (see [below for nested schema](#nestedatt--redistribute_ospf))
114120
- `redistribute_static` (Boolean) Static routes
115121
- `redistribute_static_metric` (Number) Metric for redistributed routes
116122
- Range: `0`-`4294967295`
123+
- `redistribute_static_route_policy` (String) Route policy reference
117124

118125
### Read-Only
119126

@@ -144,6 +151,10 @@ Required:
144151
- `masklength` (Number) Network in prefix/length format (prefix part)
145152
- Range: `0`-`128`
146153

154+
Optional:
155+
156+
- `route_policy` (String) Route-policy to modify the attributes
157+
147158

148159
<a id="nestedatt--redistribute_isis"></a>
149160
### Nested Schema for `redistribute_isis`
@@ -163,6 +174,7 @@ Optional:
163174
- `level_two_one_inter_area` (Boolean) Redistribute ISIS level 1 inter-area routes
164175
- `metric` (Number) Metric for redistributed routes
165176
- Range: `0`-`4294967295`
177+
- `route_policy` (String) Route policy reference
166178

167179

168180
<a id="nestedatt--redistribute_ospf"></a>
@@ -182,6 +194,7 @@ Optional:
182194
- `match_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
183195
- `metric` (Number) Metric for redistributed routes
184196
- Range: `0`-`4294967295`
197+
- `route_policy` (String) Route policy reference
185198

186199
## Import
187200

docs/resources/router_bgp_neighbor_address_family.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ resource "iosxr_router_bgp_neighbor_address_family" "example" {
2323
advertise_vpnv4_unicast_enable_re_originated_stitching_rt = true
2424
next_hop_self_inheritance_disable = true
2525
encapsulation_type_srv6 = true
26+
route_policy_in = "ROUTE_POLICY_1"
27+
route_policy_out = "ROUTE_POLICY_1"
2628
}
2729
```
2830

@@ -45,6 +47,8 @@ resource "iosxr_router_bgp_neighbor_address_family" "example" {
4547
- `encapsulation_type_srv6` (Boolean) SRv6 encapsulation
4648
- `import_stitching_rt_re_originate_stitching_rt` (Boolean) Reoriginate imported routes by attaching stitching RTs
4749
- `next_hop_self_inheritance_disable` (Boolean) Prevent next-hop-self from being inherited from the parent
50+
- `route_policy_in` (String) Apply route policy to inbound routes
51+
- `route_policy_out` (String) Apply route policy to outbound routes
4852
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
4953
- `route_reflector_client_inheritance_disable` (Boolean) Prevent route-reflector-client from being inherited from the parent
5054

docs/resources/router_bgp_vrf_address_family.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@ resource "iosxr_router_bgp_vrf_address_family" "example" {
1717
as_number = "65001"
1818
vrf_name = "VRF1"
1919
af_name = "ipv4-unicast"
20+
additional_paths_send = true
21+
additional_paths_receive = true
22+
additional_paths_selection_route_policy = "ROUTE_POLICY_1"
23+
advertise_best_external = true
24+
allocate_label_all = true
2025
maximum_paths_ebgp_multipath = 10
2126
maximum_paths_ibgp_multipath = 10
2227
label_mode_per_ce = false
2328
label_mode_per_vrf = false
2429
redistribute_connected = true
2530
redistribute_connected_metric = 10
31+
redistribute_connected_route_policy = "ROUTE_POLICY_1"
2632
redistribute_static = true
2733
redistribute_static_metric = 10
34+
redistribute_static_route_policy = "ROUTE_POLICY_1"
2835
segment_routing_srv6_locator = "LocAlgo11"
2936
segment_routing_srv6_alloc_mode_per_vrf = true
3037
aggregate_addresses = [
@@ -38,8 +45,9 @@ resource "iosxr_router_bgp_vrf_address_family" "example" {
3845
]
3946
networks = [
4047
{
41-
address = "10.1.0.0"
42-
masklength = 16
48+
address = "10.1.0.0"
49+
masklength = 16
50+
route_policy = "ROUTE_POLICY_1"
4351
}
4452
]
4553
redistribute_ospf = [
@@ -52,6 +60,7 @@ resource "iosxr_router_bgp_vrf_address_family" "example" {
5260
match_external_nssa_external = false
5361
match_nssa_external = false
5462
metric = 100
63+
route_policy = "ROUTE_POLICY_1"
5564
}
5665
]
5766
}
@@ -69,7 +78,13 @@ resource "iosxr_router_bgp_vrf_address_family" "example" {
6978

7079
### Optional
7180

81+
- `additional_paths_receive` (Boolean) Additional paths Receive capability
82+
- `additional_paths_selection_route_policy` (String) Route-policy for additional paths selection
83+
- `additional_paths_send` (Boolean) Additional paths Send capability
84+
- `advertise_best_external` (Boolean) Advertise best-external path
7285
- `aggregate_addresses` (Attributes List) IPv6 Aggregate address and mask or masklength (see [below for nested schema](#nestedatt--aggregate_addresses))
86+
- `allocate_label_all` (Boolean) Allocate labels for all prefixes
87+
- `allocate_label_all_unlabeled_path` (Boolean) Allocate label for unlabeled paths too
7388
- `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`.
7489
- Choices: `all`, `attributes`
7590
- `device` (String) A device name from the provider configuration.
@@ -85,10 +100,12 @@ resource "iosxr_router_bgp_vrf_address_family" "example" {
85100
- `redistribute_connected` (Boolean) Connected routes
86101
- `redistribute_connected_metric` (Number) Metric for redistributed routes
87102
- Range: `0`-`4294967295`
103+
- `redistribute_connected_route_policy` (String) Route policy reference
88104
- `redistribute_ospf` (Attributes List) Open Shortest Path First (OSPF/OSPFv3) (see [below for nested schema](#nestedatt--redistribute_ospf))
89105
- `redistribute_static` (Boolean) Static routes
90106
- `redistribute_static_metric` (Number) Metric for redistributed routes
91107
- Range: `0`-`4294967295`
108+
- `redistribute_static_route_policy` (String) Route policy reference
92109
- `segment_routing_srv6_alloc_mode_per_vrf` (Boolean) Set per VRF label mode
93110
- `segment_routing_srv6_locator` (String) Specify locator
94111

@@ -121,6 +138,10 @@ Required:
121138
- `masklength` (Number) Network in prefix/length format (prefix part)
122139
- Range: `0`-`128`
123140

141+
Optional:
142+
143+
- `route_policy` (String) Route-policy to modify the attributes
144+
124145

125146
<a id="nestedatt--redistribute_ospf"></a>
126147
### Nested Schema for `redistribute_ospf`
@@ -139,6 +160,7 @@ Optional:
139160
- `match_nssa_external` (Boolean) Redistribute OSPF NSSA external routes
140161
- `metric` (Number) Metric for redistributed routes
141162
- Range: `0`-`4294967295`
163+
- `route_policy` (String) Route policy reference
142164

143165
## Import
144166

examples/resources/iosxr_router_bgp_address_family/resource.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ resource "iosxr_router_bgp_address_family" "example" {
1212
label_mode_per_vrf = false
1313
redistribute_connected = true
1414
redistribute_connected_metric = 10
15+
redistribute_connected_route_policy = "ROUTE_POLICY_1"
1516
redistribute_static = true
1617
redistribute_static_metric = 10
18+
redistribute_static_route_policy = "ROUTE_POLICY_1"
1719
aggregate_addresses = [
1820
{
1921
address = "10.0.0.0"
@@ -25,8 +27,9 @@ resource "iosxr_router_bgp_address_family" "example" {
2527
]
2628
networks = [
2729
{
28-
address = "10.1.0.0"
29-
masklength = 16
30+
address = "10.1.0.0"
31+
masklength = 16
32+
route_policy = "ROUTE_POLICY_1"
3033
}
3134
]
3235
redistribute_isis = [
@@ -40,6 +43,7 @@ resource "iosxr_router_bgp_address_family" "example" {
4043
level_two_one_inter_area = false
4144
level_one_inter_area = false
4245
metric = 100
46+
route_policy = "ROUTE_POLICY_1"
4347
}
4448
]
4549
redistribute_ospf = [
@@ -52,6 +56,7 @@ resource "iosxr_router_bgp_address_family" "example" {
5256
match_external_nssa_external = false
5357
match_nssa_external = false
5458
metric = 100
59+
route_policy = "ROUTE_POLICY_1"
5560
}
5661
]
5762
}

0 commit comments

Comments
 (0)