Skip to content

Commit

Permalink
Additional bgp, ospf and ethernet resources (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
moskrive authored Jun 10, 2024
1 parent 9309635 commit 0515547
Show file tree
Hide file tree
Showing 41 changed files with 1,116 additions and 27 deletions.
4 changes: 4 additions & 0 deletions docs/data-sources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ data "nxos_bgp_peer" "example" {
### Read-Only

- `description` (String) Peer description.
- `ebgp_multihop_ttl` (Number) eBGP Multihop TTL
- `hold_time` (Number) BGP Hold Timer in seconds. The value must be greater than the keepalive timer
- `id` (String) The distinguished name of the object.
- `keepalive` (Number) BGP Keepalive Timer in seconds
- `password` (String) Password.
- `password_type` (String) Password Encryption Type.
- `peer_control` (String) Peer Controls.
- `peer_template` (String) Peer template name.
- `peer_type` (String) Neighbor Fabric Type.
- `remote_asn` (String) Peer autonomous system number.
Expand Down
41 changes: 41 additions & 0 deletions docs/data-sources/bgp_peer_local_asn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_bgp_peer_local_asn Data Source - terraform-provider-nxos"
subcategory: "BGP"
description: |-
This data source can read the BGP peer local asn configuration.
API Documentation: bgpLocalAsn https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:localasn/
---

# nxos_bgp_peer_local_asn (Data Source)

This data source can read the BGP peer local asn configuration.

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

## Example Usage

```terraform
data "nxos_bgp_peer_local_asn" "example" {
vrf = "default"
address = "192.168.0.1"
}
```

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

### Required

- `address` (String) Peer address.
- `vrf` (String) VRF name.

### Optional

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

### Read-Only

- `asn_propagation` (String) ASN Propagation.
- `id` (String) The distinguished name of the object.
- `local_asn` (String) Local Autonomous system number.
1 change: 1 addition & 0 deletions docs/data-sources/ethernet.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ data "nxos_ethernet" "example" {

### Read-Only

- `default_admin_status` (String) Default admin status
- `id` (String) The distinguished name of the object.
- `mtu` (Number) System jumbo MTU.
1 change: 1 addition & 0 deletions docs/data-sources/ospf_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data "nxos_ospf_vrf" "example" {
- `admin_state` (String) Administrative state.
- `bandwidth_reference` (Number) Bandwidth reference value.
- `bandwidth_reference_unit` (String) Bandwidth reference unit.
- `control` (String) Controls.
- `distance` (Number) Administrative distance preference.
- `id` (String) The distinguished name of the object.
- `router_id` (String) Router ID.
1 change: 1 addition & 0 deletions docs/guides/supported_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_family) | [nxos_bgp_peer_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_address_family) |
| [bgpPfxCtrlP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:PfxCtrlP/) | [nxos_bgp_peer_address_family_prefix_list_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_family_prefix_list_control) | [nxos_bgp_peer_address_family_prefix_list_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_address_family_prefix_list_control) |
| [bgpRtCtrlP](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:RtCtrlP/) | [nxos_bgp_peer_address_family_route_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_family_route_control) | [nxos_bgp_peer_address_family_route_control](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_address_family_route_control) |
| [bgpLocalAsn](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:localasn/) | [nxos_bgp_peer_local_asn](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_local_asn) | [nxos_bgp_peer_local_asn](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_local_asn) |
| [bgpPeerCont](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:PeerCont/) | [nxos_bgp_peer_template](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_template) | [nxos_bgp_peer_template](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/bgp_peer_template) |
| [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) |
Expand Down
35 changes: 24 additions & 11 deletions docs/resources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-
Parent resources
nxos_bgp_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_vrf
Child resources
nxos_bgp_peer_address_family https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_family
nxos_bgp_peer_address_family https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_familynxos_bgp_peer_local_asn https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_local_asn
Referenced resources
nxos_bgp_peer_template https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_template
---
Expand All @@ -26,6 +26,7 @@ This resource can manage the BGP peer configuration.
### Child resources

- [nxos_bgp_peer_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_address_family)
- [nxos_bgp_peer_local_asn](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer_local_asn)

### Referenced resources

Expand All @@ -35,16 +36,20 @@ This resource can manage the BGP peer configuration.

```terraform
resource "nxos_bgp_peer" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
source_interface = "lo0"
hold_time = 45
keepalive = 15
asn = "65001"
vrf = "default"
address = "192.168.0.1"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
source_interface = "lo0"
hold_time = 45
keepalive = 15
ebgp_multihop_ttl = 5
peer_control = "bfd"
password_type = "LINE"
password = "secret_password"
}
```

Expand All @@ -61,12 +66,20 @@ resource "nxos_bgp_peer" "example" {

- `description` (String) Peer description.
- `device` (String) A device name from the provider configuration.
- `ebgp_multihop_ttl` (Number) eBGP Multihop TTL
- Range: `2`-`255`
- `hold_time` (Number) BGP Hold Timer in seconds. The value must be greater than the keepalive timer
- Range: `3`-`3600`
- Default value: `180`
- `keepalive` (Number) BGP Keepalive Timer in seconds
- Range: `0`-`3600`
- Default value: `60`
- `password` (String) Password.
- `password_type` (String) Password Encryption Type.
- Choices: `0`, `3`, `LINE`, `7`
- Default value: `LINE`
- `peer_control` (String) Peer Controls.
- Choices: `bfd`, `dis-conn-check`, `cap-neg-off`, `no-dyn-cap`
- `peer_template` (String) Peer template name.
- `peer_type` (String) Neighbor Fabric Type.
- Choices: `fabric-internal`, `fabric-external`, `fabric-border-leaf`
Expand Down
59 changes: 59 additions & 0 deletions docs/resources/bgp_peer_local_asn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_bgp_peer_local_asn Resource - terraform-provider-nxos"
subcategory: "BGP"
description: |-
This resource can manage the BGP peer local asn configuration.
API Documentation: bgpLocalAsn https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:localasn/
Parent resources
nxos_bgp_peer https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_peer
---

# nxos_bgp_peer_local_asn (Resource)

This resource can manage the BGP peer local asn configuration.

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

### Parent resources

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

## Example Usage

```terraform
resource "nxos_bgp_peer_local_asn" "example" {
asn_propagation = "prepend"
local_asn = "65001"
vrf = "default"
address = "192.168.0.1"
}
```

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

### Required

- `address` (String) Peer address.
- `local_asn` (String) Local Autonomous system number.
- `vrf` (String) VRF name.

### Optional

- `asn_propagation` (String) ASN Propagation.
- Choices: `none`, `no-prepend`, `replace-as`, `dual-as`
- Default value: `none`
- `device` (String) A device name from the provider configuration.

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_bgp_peer_local_asn.example "sys/bgp/inst/dom-[default]/peer-[192.168.0.1]/localasn"
```
6 changes: 5 additions & 1 deletion docs/resources/ethernet.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ This resource can manage global ethernet settings.

```terraform
resource "nxos_ethernet" "example" {
mtu = 9216
mtu = 9216
default_admin_status = "up"
}
```

Expand All @@ -26,6 +27,9 @@ resource "nxos_ethernet" "example" {

### Optional

- `default_admin_status` (String) Default admin status
- Choices: `up`, `down`
- Default value: `up`
- `device` (String) A device name from the provider configuration.
- `mtu` (Number) System jumbo MTU.
- Range: `576`-`9216`
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/ospf_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ resource "nxos_ospf_vrf" "example" {
bandwidth_reference_unit = "mbps"
distance = 110
router_id = "34.56.78.90"
control = "bfd"
}
```

Expand All @@ -65,6 +66,9 @@ resource "nxos_ospf_vrf" "example" {
- `bandwidth_reference_unit` (String) Bandwidth reference unit.
- Choices: `mbps`, `gbps`
- Default value: `mbps`
- `control` (String) Controls.
- Choices: `unspecified`, `bfd`, `name-lookup`, `default-passive`, `segrt`
- Default value: `unspecified`
- `device` (String) A device name from the provider configuration.
- `distance` (Number) Administrative distance preference.
- Range: `1`-`255`
Expand Down
4 changes: 4 additions & 0 deletions examples/data-sources/nxos_bgp_peer_local_asn/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "nxos_bgp_peer_local_asn" "example" {
vrf = "default"
address = "192.168.0.1"
}
24 changes: 14 additions & 10 deletions examples/resources/nxos_bgp_peer/resource.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
resource "nxos_bgp_peer" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
source_interface = "lo0"
hold_time = 45
keepalive = 15
asn = "65001"
vrf = "default"
address = "192.168.0.1"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
source_interface = "lo0"
hold_time = 45
keepalive = 15
ebgp_multihop_ttl = 5
peer_control = "bfd"
password_type = "LINE"
password = "secret_password"
}
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_peer_local_asn/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_bgp_peer_local_asn.example "sys/bgp/inst/dom-[default]/peer-[192.168.0.1]/localasn"
6 changes: 6 additions & 0 deletions examples/resources/nxos_bgp_peer_local_asn/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "nxos_bgp_peer_local_asn" "example" {
asn_propagation = "prepend"
local_asn = "65001"
vrf = "default"
address = "192.168.0.1"
}
3 changes: 2 additions & 1 deletion examples/resources/nxos_ethernet/resource.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
resource "nxos_ethernet" "example" {
mtu = 9216
mtu = 9216
default_admin_status = "up"
}
1 change: 1 addition & 0 deletions examples/resources/nxos_ospf_vrf/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ resource "nxos_ospf_vrf" "example" {
bandwidth_reference_unit = "mbps"
distance = 110
router_id = "34.56.78.90"
control = "bfd"
}
36 changes: 36 additions & 0 deletions gen/definitions/bgp_peer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parents:
- BGP VRF
children:
- BGP Peer Address Family
- BGP Peer Local ASN
references:
- BGP Peer Template
attributes:
Expand Down Expand Up @@ -79,6 +80,41 @@ attributes:
example: 15
min_int: 0
max_int: 3600
- nxos_name: ttl
tf_name: ebgp_multihop_ttl
type: Int64
description: "eBGP Multihop TTL"
example: 5
min_int: 2
max_int: 255
omit_empty_value: true
- nxos_name: ctrl
tf_name: peer_control
type: String
description: "Peer Controls."
enum_values:
- bfd
- dis-conn-check
- cap-neg-off
- no-dyn-cap
example: bfd
- nxos_name: passwdType
tf_name: password_type
type: String
description: "Password Encryption Type."
enum_values:
- "0"
- "3"
- LINE
- "7"
example: LINE
default_value: LINE
- nxos_name: password
tf_name: password
description: "Password."
type: String
example: secret_password
write_only: true
test_prerequisites:
- dn: sys/fm/bgp
class_name: fmBgp
Expand Down
Loading

0 comments on commit 0515547

Please sign in to comment.