Skip to content

Commit

Permalink
Add bgp route redistribution object (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomezve committed Jun 6, 2024
1 parent d3963bc commit e808ab9
Show file tree
Hide file tree
Showing 18 changed files with 1,022 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ website/vendor

# Keep windows files with windows line endings
*.winfile eol=crlf

# Compiled provider binary
terraform-provider-nxos
48 changes: 48 additions & 0 deletions docs/data-sources/bgp_route_redistribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_bgp_route_redistribution Data Source - terraform-provider-nxos"
subcategory: "BGP"
description: |-
This data source can read the BGP (VRF) route redistribution configuration.
API Documentation: bgpInterLeakP https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:InterLeakP/
---

# nxos_bgp_route_redistribution (Data Source)

This data source can read the BGP (VRF) route redistribution configuration.

- API Documentation: [bgpInterLeakP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:InterLeakP/)

## Example Usage

```terraform
data "nxos_bgp_route_redistribution" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
protocol = "ospf"
protocol_instance = "OSPF1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `address_family` (String) Address Family.
- `asn` (String) Autonomous system number.
- `protocol` (String) The list of protocols to match.
- `protocol_instance` (String) The inter protocol route leak policy instance (Use `none` for `static` and `direct` protocols).
- `vrf` (String) VRF name.

### Optional

- `device` (String) A device name from the provider configuration.

### Read-Only

- `id` (String) The distinguished name of the object.
- `route_map` (String) The name of the default route leak policy route map. This route map name is used to control distribution.
- `scope` (String) The domain applicable to the capability.
- `srv6_prefix_type` (String) SRv6 Prefix Type; Valid only when proto is srv6.
1 change: 1 addition & 0 deletions docs/guides/supported_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ For the following DME objects a corresponding Terraform resource and data source
| [bgpPeerAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:PeerAf/) | [nxos_bgp_peer_template_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_template_address_family) | [nxos_bgp_peer_template_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_template_address_family) |
| [bgpMaxPfxP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:MaxPfxP/) | [nxos_bgp_peer_template_max_prefix](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_template_max_prefix) | [nxos_bgp_peer_template_max_prefix](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_template_max_prefix) |
| [bgpRtCtrl](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:RtCtrl/) | [nxos_bgp_route_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_route_control) | [nxos_bgp_route_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_route_control) |
| [bgpInterLeakP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:InterLeakP/) | [nxos_bgp_route_redistribution](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_route_redistribution) | [nxos_bgp_route_redistribution](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_route_redistribution) |
| [bgpDom](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:Dom/) | [nxos_bgp_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_vrf) | [nxos_bgp_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_vrf) |
| [l2BD](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%202/l2:BD/) | [nxos_bridge_domain](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bridge_domain) | [nxos_bridge_domain](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bridge_domain) |
| [ipqosCMapInst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Qos/ipqos:CMapInst/) | [nxos_default_qos_class_map](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/default_qos_class_map) | [nxos_default_qos_class_map](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/default_qos_class_map) |
Expand Down
3 changes: 2 additions & 1 deletion docs/resources/bgp_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-
Parent resources
nxosbgpvrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_vrf
Child resources
nxosbgpadvertised_prefix https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_advertised_prefix
nxosbgpadvertised_prefix https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_advertised_prefixnxosbgproute_redistribution https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_route_redistribution
---

# nxos_bgp_address_family (Resource)
Expand All @@ -24,6 +24,7 @@ This resource can manage the BGP (VRF) address family configuration.
### Child resources

- [nxos_bgp_advertised_prefix](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_advertised_prefix)
- [nxos_bgp_route_redistribution](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_route_redistribution)

## Example Usage

Expand Down
74 changes: 74 additions & 0 deletions docs/resources/bgp_route_redistribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_bgp_route_redistribution Resource - terraform-provider-nxos"
subcategory: "BGP"
description: |-
This resource can manage the BGP (VRF) route redistribution configuration.
API Documentation: bgpInterLeakP https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:InterLeakP/
Parent resources
nxosbgpaddress_family https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_address_family
---

# nxos_bgp_route_redistribution (Resource)

This resource can manage the BGP (VRF) route redistribution configuration.

- API Documentation: [bgpInterLeakP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:InterLeakP/)

### Parent resources

- [nxos_bgp_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_address_family)

## Example Usage

```terraform
resource "nxos_bgp_route_redistribution" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
protocol = "ospf"
protocol_instance = "OSPF1"
route_map = "route_map_ospf_1"
scope = "inter"
srv6_prefix_type = "unspecified"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `address_family` (String) Address Family.
- Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`, `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`, `ipv4-mdt`
- Default value: `ipv4-ucast`
- `asn` (String) Autonomous system number.
- `protocol` (String) The list of protocols to match.
- Choices: `unspecified`, `static`, `direct`, `bgp`, `isis`, `ospf`, `ospfv3`, `eigrp`, `host`, `rip`, `amt`, `lisp`, `hmm`, `am`, `srv6`
- Default value: `unspecified`
- `protocol_instance` (String) The inter protocol route leak policy instance (Use `none` for `static` and `direct` protocols).
- Default value: `none`
- `vrf` (String) VRF name.

### Optional

- `device` (String) A device name from the provider configuration.
- `route_map` (String) The name of the default route leak policy route map. This route map name is used to control distribution.
- `scope` (String) The domain applicable to the capability.
- Choices: `intra`, `inter`, `defrt`
- Default value: `inter`
- `srv6_prefix_type` (String) SRv6 Prefix Type; Valid only when proto is srv6.
- Choices: `unspecified`, `locator`
- Default value: `unspecified`

### Read-Only

- `id` (String) The distinguished name of the object.

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_bgp_route_redistribution.example "sys/bgp/inst/dom-[default]/af-[ipv4-ucast]/interleak-[ospf]-interleak-[OSPF1]"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "nxos_bgp_route_redistribution" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
protocol = "ospf"
protocol_instance = "OSPF1"
}
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_route_redistribution/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_bgp_route_redistribution.example "sys/bgp/inst/dom-[default]/af-[ipv4-ucast]/interleak-[ospf]-interleak-[OSPF1]"
10 changes: 10 additions & 0 deletions examples/resources/nxos_bgp_route_redistribution/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "nxos_bgp_route_redistribution" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
protocol = "ospf"
protocol_instance = "OSPF1"
route_map = "route_map_ospf_1"
scope = "inter"
srv6_prefix_type = "unspecified"
}
1 change: 1 addition & 0 deletions gen/definitions/bgp_address_family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parents:
- BGP VRF
children:
- BGP Advertised Prefix
- BGP Route Redistribution
attributes:
- nxos_name: asn
tf_name: asn
Expand Down
134 changes: 134 additions & 0 deletions gen/definitions/bgp_route_redistribution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
name: BGP Route Redistribution
class_name: bgpInterLeakP
dn: sys/bgp/inst/dom-[%s]/af-[%s]/interleak-[%s]-interleak-[%s]
ds_description: This data source can read the BGP (VRF) route redistribution configuration.
res_description: This resource can manage the BGP (VRF) route redistribution configuration.
doc_path: Routing%20and%20Forwarding/bgp:InterLeakP/
doc_category: BGP
parents:
- BGP Address Family
attributes:
- nxos_name: asn
tf_name: asn
type: String
reference_only: true
description: 'Autonomous system number.'
example: '65001'
- nxos_name: name
tf_name: vrf
type: String
id: true
reference_only: true
description: 'VRF name.'
example: default
- nxos_name: type
tf_name: address_family
type: String
id: true
reference_only: true
description: 'Address Family.'
enum_values:
- ipv4-ucast
- ipv4-mcast
- vpnv4-ucast
- ipv6-ucast
- ipv6-mcast
- vpnv6-ucast
- vpnv6-mcast
- l2vpn-evpn
- ipv4-lucast
- ipv6-lucast
- lnkstate
- ipv4-mvpn
- ipv6-mvpn
- l2vpn-vpls
- ipv4-mdt
default_value: 'ipv4-ucast'
example: 'ipv4-ucast'
- nxos_name: proto
tf_name: protocol
type: String
id: true
description: 'The list of protocols to match.'
enum_values:
- unspecified
- static
- direct
- bgp
- isis
- ospf
- ospfv3
- eigrp
- host
- rip
- amt
- lisp
- hmm
- am
- srv6
default_value: 'unspecified'
example: 'ospf'
- nxos_name: inst
tf_name: protocol_instance
type: String
id: true
description: 'The inter protocol route leak policy instance (Use `none` for `static` and `direct` protocols).'
default_value: 'none'
example: 'OSPF1'
- nxos_name: rtMap
tf_name: route_map
type: String
description: 'The name of the default route leak policy route map. This route map name is used to control distribution.'
example: 'route_map_ospf_1'
- nxos_name: scope
tf_name: scope
type: String
description: 'The domain applicable to the capability.'
enum_values:
- intra
- inter
- defrt
default_value: 'inter'
example: 'inter'
omit_empty_value: true
- nxos_name: srv6PrefixType
tf_name: srv6_prefix_type
type: String
description: 'SRv6 Prefix Type; Valid only when proto is srv6.'
enum_values:
- unspecified
- locator
default_value: 'unspecified'
example: 'unspecified'
omit_empty_value: true
test_prerequisites:
- dn: sys/fm/bgp
class_name: fmBgp
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/bgp
class_name: bgpEntity
dependencies: [0]
- dn: sys/bgp/inst
class_name: bgpInst
attributes:
- name: adminSt
value: enabled
- name: asn
value: '65001'
dependencies: [1]
- dn: sys/bgp/inst/dom-[default]
class_name: bgpDom
attributes:
- name: name
value: default
dependencies: [2]
- dn: sys/bgp/inst/dom-[default]/af-[ipv4-ucast]
class_name: bgpDomAf
attributes:
- name: type
value: ipv4-ucast
dependencies: [3]
Loading

0 comments on commit e808ab9

Please sign in to comment.