Skip to content

Commit

Permalink
Add asn attribute to bgp resources
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed May 24, 2022
1 parent dd9436d commit 7a73ef7
Show file tree
Hide file tree
Showing 84 changed files with 311 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

- Allow multiple values for control attribute of nxos_bgp_peer_address_family and nxos_bgp_peer_template_address_family resources
- Handle deletion of non-existent objects gracefully
- BREAKING CHANGE: Add asn attribute to nxos_bgp_address_family, nxos_bgp_graceful_restart, nxos_bgp_peer_address_family, nxos_bgp_peer_template_address_family, nxos_bgp_peer_template_max_prefix, nxos_bgp_peer_template, nxos_bgp_peer, nxos_route_control and nxos_bgp_vrf resources.
- BREAKING CHANGE: Rename asn attribute of nxos_bgp_peer resource to remote_asn
- BREAKING CHANGE: Rename asn attribute of nxos_bgp_peer_template resource to remote_asn

## 0.3.13

Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data "nxos_bgp_address_family" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `critical_nexthop_timeout` (Number) The next-hop address tracking delay timer for critical next-hop reachability routes.
- `id` (String) The distinguished name of the object.
- `non_critical_nexthop_timeout` (Number) The next-hop address tracking delay timer for non-critical next-hop reachability routes.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_graceful_restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ data "nxos_bgp_graceful_restart" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `id` (String) The distinguished name of the object.
- `restart_interval` (Number) The graceful restart interval.
- `stale_interval` (Number) The stale interval for routes advertised by the BGP peer.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ data "nxos_bgp_peer" "example" {
- `id` (String) The distinguished name of the object.
- `peer_template` (String) Peer template name.
- `peer_type` (String) Neighbor Fabric Type.
- `remote_asn` (String) Peer autonomous system number.
- `source_interface` (String) Source Interface. Must match first field in the output of `show intf brief`.


1 change: 1 addition & 0 deletions docs/data-sources/bgp_peer_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ data "nxos_bgp_peer_address_family" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `control` (String) Peer address-family control. Choices: `rr-client`, `nh-self`, `dis-peer-as-check`, `allow-self-as`, `default-originate`, `advertisement-interval`, `suppress-inactive`, `nh-self-all`. Can be an empty string. Allowed formats:
- Single value. Example: `nh-self`
- Multiple values (comma-separated). Example: `dis-peer-as-check,nh-self,rr-client,suppress-inactive`. In this case values must be in alphabetical order.
Expand Down
3 changes: 2 additions & 1 deletion docs/data-sources/bgp_peer_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ data "nxos_bgp_peer_template" "example" {

### Read-Only

- `asn` (String) Peer template Autonomous system number.
- `asn` (String) Autonomous system number.
- `description` (String) Peer template description.
- `id` (String) The distinguished name of the object.
- `peer_type` (String) Neighbor Fabric Type.
- `remote_asn` (String) Peer template autonomous system number.
- `source_interface` (String) Source Interface. Must match first field in the output of `show intf brief`.


1 change: 1 addition & 0 deletions docs/data-sources/bgp_peer_template_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data "nxos_bgp_peer_template_address_family" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `control` (String) Peer address-family control. Choices: `rr-client`, `nh-self`, `dis-peer-as-check`, `allow-self-as`, `default-originate`, `advertisement-interval`, `suppress-inactive`, `nh-self-all`. Can be an empty string. Allowed formats:
- Single value. Example: `nh-self`
- Multiple values (comma-separated). Example: `dis-peer-as-check,nh-self,rr-client,suppress-inactive`. In this case values must be in alphabetical order.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_peer_template_max_prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ data "nxos_bgp_peer_template_max_prefix" "example" {
### Read-Only

- `action` (String) Action to do when limit is exceeded.
- `asn` (String) Autonomous system number.
- `id` (String) The distinguished name of the object.
- `maximum_prefix` (Number) Maximum number of prefixes allowed from the peer.
- `restart_time` (Number) The period of time in minutes before restarting the peer when the prefix limit is reached.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_route_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ data "nxos_bgp_route_control" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `enforce_first_as` (String) Enforce First AS For Ebgp. Can be configured only for VRF default.
- `fib_accelerate` (String) Accelerate the hardware updates for IP/IPv6 adjacencies for neighbor. Can be configured only for VRF default.
- `id` (String) The distinguished name of the object.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/bgp_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ data "nxos_bgp_vrf" "example" {

### Read-Only

- `asn` (String) Autonomous system number.
- `id` (String) The distinguished name of the object.
- `router_id` (String) Router ID.

Expand Down
3 changes: 3 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ description: |-

- Allow multiple values for control attribute of nxos_bgp_peer_address_family and nxos_bgp_peer_template_address_family resources
- Handle deletion of non-existent objects gracefully
- BREAKING CHANGE: Add asn attribute to nxos_bgp_address_family, nxos_bgp_graceful_restart, nxos_bgp_peer_address_family, nxos_bgp_peer_template_address_family, nxos_bgp_peer_template_max_prefix, nxos_bgp_peer_template, nxos_bgp_peer, nxos_route_control and nxos_bgp_vrf resources.
- BREAKING CHANGE: Rename asn attribute of nxos_bgp_peer resource to remote_asn
- BREAKING CHANGE: Rename asn attribute of nxos_bgp_peer_template resource to remote_asn

## 0.3.13

Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This resource can manage the BGP (VRF) address family configuration.

```terraform
resource "nxos_bgp_address_family" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
critical_nexthop_timeout = 1800
Expand All @@ -42,6 +43,7 @@ resource "nxos_bgp_address_family" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `critical_nexthop_timeout` (Number) The next-hop address tracking delay timer for critical next-hop reachability routes.
- Range: `1`-`4294967295`
- Default value: `3000`
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_graceful_restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This resource can manage the BGP domain (VRF) graceful restart configuration.

```terraform
resource "nxos_bgp_graceful_restart" "example" {
asn = "65001"
vrf = "default"
restart_interval = 240
stale_interval = 1800
Expand All @@ -38,6 +39,7 @@ resource "nxos_bgp_graceful_restart" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `device` (String) A device name from the provider configuration.
- `restart_interval` (Number) The graceful restart interval.
- Range: `1`-`3600`
Expand Down
4 changes: 3 additions & 1 deletion docs/resources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ This resource can manage the BGP peer configuration.

```terraform
resource "nxos_bgp_peer" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
asn = "65002"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
Expand All @@ -62,6 +63,7 @@ resource "nxos_bgp_peer" "example" {
- `peer_type` (String) Neighbor Fabric Type.
- Choices: `fabric-internal`, `fabric-external`, `fabric-border-leaf`
- Default value: `fabric-internal`
- `remote_asn` (String) Peer autonomous system number.
- `source_interface` (String) Source Interface. Must match first field in the output of `show intf brief`.
- Default value: `unspecified`

Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_peer_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This resource can manage the BGP peer address family configuration.

```terraform
resource "nxos_bgp_peer_address_family" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
address_family = "ipv4-ucast"
Expand All @@ -45,6 +46,7 @@ resource "nxos_bgp_peer_address_family" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `control` (String) Peer address-family control. Choices: `rr-client`, `nh-self`, `dis-peer-as-check`, `allow-self-as`, `default-originate`, `advertisement-interval`, `suppress-inactive`, `nh-self-all`. Can be an empty string. Allowed formats:
- Single value. Example: `nh-self`
- Multiple values (comma-separated). Example: `dis-peer-as-check,nh-self,rr-client,suppress-inactive`. In this case values must be in alphabetical order.
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/bgp_peer_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ This resource can manage the BGP peer template configuration.

```terraform
resource "nxos_bgp_peer_template" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
asn = "65002"
remote_asn = "65002"
description = "My Description"
peer_type = "fabric-internal"
source_interface = "lo0"
Expand All @@ -46,12 +47,13 @@ resource "nxos_bgp_peer_template" "example" {

### Optional

- `asn` (String) Peer template Autonomous system number.
- `asn` (String) Autonomous system number.
- `description` (String) Peer template description.
- `device` (String) A device name from the provider configuration.
- `peer_type` (String) Neighbor Fabric Type.
- Choices: `fabric-internal`, `fabric-external`, `fabric-border-leaf`
- Default value: `fabric-internal`
- `remote_asn` (String) Peer template autonomous system number.
- `source_interface` (String) Source Interface. Must match first field in the output of `show intf brief`.
- Default value: `unspecified`

Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_peer_template_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This resource can manage the BGP peer template address family configuration.

```terraform
resource "nxos_bgp_peer_template_address_family" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
address_family = "ipv4-ucast"
control = "nh-self,rr-client"
Expand All @@ -49,6 +50,7 @@ resource "nxos_bgp_peer_template_address_family" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `control` (String) Peer address-family control. Choices: `rr-client`, `nh-self`, `dis-peer-as-check`, `allow-self-as`, `default-originate`, `advertisement-interval`, `suppress-inactive`, `nh-self-all`. Can be an empty string. Allowed formats:
- Single value. Example: `nh-self`
- Multiple values (comma-separated). Example: `dis-peer-as-check,nh-self,rr-client,suppress-inactive`. In this case values must be in alphabetical order.
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_peer_template_max_prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This resource can manage the BGP peer template Maximum Prefix Policy configurati

```terraform
resource "nxos_bgp_peer_template_max_prefix" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
address_family = "ipv4-ucast"
action = "log"
Expand All @@ -47,6 +48,7 @@ resource "nxos_bgp_peer_template_max_prefix" "example" {
- `action` (String) Action to do when limit is exceeded.
- Choices: `log`, `shut`, `restart`
- Default value: `shut`
- `asn` (String) Autonomous system number.
- `device` (String) A device name from the provider configuration.
- `maximum_prefix` (Number) Maximum number of prefixes allowed from the peer.
- Range: `0`-`4294967295`
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/bgp_route_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This resource can manage the BGP Route Control configuration.

```terraform
resource "nxos_bgp_route_control" "example" {
asn = "65001"
vrf = "default"
enforce_first_as = "disabled"
fib_accelerate = "enabled"
Expand All @@ -40,6 +41,7 @@ resource "nxos_bgp_route_control" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `device` (String) A device name from the provider configuration.
- `enforce_first_as` (String) Enforce First AS For Ebgp. Can be configured only for VRF default.
- Choices: `enabled`, `disabled`
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/bgp_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-
Parent resources
nxosbgpinstance https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_instance
Child resources
nxosbgpaddress_family https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_address_familynxosbgpgraceful_restart https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_graceful_restartnxosbgppeer https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peernxosbgppeer_template https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peer_template
nxosbgpaddress_family https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_address_familynxosbgpgraceful_restart https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_graceful_restartnxosbgppeer https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peernxosbgppeer_template https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peer_templatenxosbgproute_control https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_route_control
Referenced resources
nxos_vrf https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/vrf
---
Expand All @@ -29,6 +29,7 @@ This resource can manage the BGP domain (VRF) configuration.
- [nxos_bgp_graceful_restart](https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_graceful_restart)
- [nxos_bgp_peer](https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peer)
- [nxos_bgp_peer_template](https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_peer_template)
- [nxos_bgp_route_control](https://registry.terraform.io/providers/netascode/nxos/latest/docs/resources/bgp_route_control)

### Referenced resources

Expand All @@ -38,6 +39,7 @@ This resource can manage the BGP domain (VRF) configuration.

```terraform
resource "nxos_bgp_vrf" "example" {
asn = "65001"
name = "default"
router_id = "1.1.1.1"
}
Expand All @@ -52,6 +54,7 @@ resource "nxos_bgp_vrf" "example" {

### Optional

- `asn` (String) Autonomous system number.
- `device` (String) A device name from the provider configuration.
- `router_id` (String) Router ID.

Expand Down
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_address_family/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_address_family" "example" {
asn = "65001"
vrf = "default"
address_family = "ipv4-ucast"
critical_nexthop_timeout = 1800
Expand Down
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_graceful_restart/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_graceful_restart" "example" {
asn = "65001"
vrf = "default"
restart_interval = 240
stale_interval = 1800
Expand Down
3 changes: 2 additions & 1 deletion examples/resources/nxos_bgp_peer/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
resource "nxos_bgp_peer" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
asn = "65002"
remote_asn = "65002"
description = "My description"
peer_template = "SPINE-PEERS"
peer_type = "fabric-internal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_peer_address_family" "example" {
asn = "65001"
vrf = "default"
address = "192.168.0.1"
address_family = "ipv4-ucast"
Expand Down
3 changes: 2 additions & 1 deletion examples/resources/nxos_bgp_peer_template/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
resource "nxos_bgp_peer_template" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
asn = "65002"
remote_asn = "65002"
description = "My Description"
peer_type = "fabric-internal"
source_interface = "lo0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_peer_template_address_family" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
address_family = "ipv4-ucast"
control = "nh-self,rr-client"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_peer_template_max_prefix" "example" {
asn = "65001"
template_name = "SPINE-PEERS"
address_family = "ipv4-ucast"
action = "log"
Expand Down
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_route_control/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_route_control" "example" {
asn = "65001"
vrf = "default"
enforce_first_as = "disabled"
fib_accelerate = "enabled"
Expand Down
1 change: 1 addition & 0 deletions examples/resources/nxos_bgp_vrf/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "nxos_bgp_vrf" "example" {
asn = "65001"
name = "default"
router_id = "1.1.1.1"
}
7 changes: 7 additions & 0 deletions gen/definitions/bgp_address_family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ doc_category: BGP
parents:
- BGP VRF
attributes:
- nxos_name: asn
tf_name: asn
type: String
reference_only: true
requires_replace: true
description: 'Autonomous system number.'
example: '65001'
- nxos_name: name
tf_name: vrf
type: String
Expand Down
7 changes: 7 additions & 0 deletions gen/definitions/bgp_graceful_restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ doc_category: BGP
parents:
- BGP VRF
attributes:
- nxos_name: asn
tf_name: asn
type: String
reference_only: true
requires_replace: true
description: 'Autonomous system number.'
example: '65001'
- nxos_name: name
tf_name: vrf
type: String
Expand Down
11 changes: 9 additions & 2 deletions gen/definitions/bgp_peer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ children:
references:
- BGP Peer Template
attributes:
- nxos_name: bgp_asn
tf_name: asn
type: String
reference_only: true
requires_replace: true
description: 'Autonomous system number.'
example: '65001'
- nxos_name: vrf_name
tf_name: vrf
type: String
Expand All @@ -27,9 +34,9 @@ attributes:
description: 'Peer address.'
example: '192.168.0.1'
- nxos_name: asn
tf_name: asn
tf_name: remote_asn
type: String
description: 'Autonomous system number.'
description: 'Peer autonomous system number.'
example: '65002'
- nxos_name: name
tf_name: description
Expand Down
Loading

0 comments on commit 7a73ef7

Please sign in to comment.