Skip to content

Commit

Permalink
Release v3.5.0 (#37)
Browse files Browse the repository at this point in the history
New Features:

- Added the `mclag` argument to the `netris_link` resource
- Added the `mclagid` argument in the `netris_lag` resource
- Added the `bfd`,`hellotimer`, `holdtimer` and `connecttimer` arguments in the `netris_bgp` resource

Fixes:

- Default value of the routemaps in the `netris_bgp` resource
  • Loading branch information
pogossian authored Sep 11, 2024
1 parent 02be159 commit 5b0becf
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 86 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io
NAMESPACE=netrisai
NAME=netris
BINARY=terraform-provider-${NAME}
VERSION=3.4.1
VERSION=3.5.0
OS_ARCH=darwin_arm64
WORKDIRECTORY=examples

Expand Down
6 changes: 5 additions & 1 deletion docs/resources/bgp.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ resource "netris_bgp" "my-bgp" {
- **multihop.updatesource** (String) When Multihop BGP peering is used it allows the operator to choose one of the loopback IP addresses of the SoftGate node as a BGP speaker source IP address.
- **multihop.hops** (Number) Multihop BGP hops count.
- **neighboras** (Number) BGP neighbor AS number.
- **outboundroutemap** (String) Reference to route-map resource ID.
- **outboundroutemap** (Number) Reference to route-map resource ID.
- **portid** (Number) Port ID where BGP neighbor cable is connected. Can't be used together `vnetid`.
- **prefixinboundmax** (String) BGP session will be interrupted if neighbor advertises more prefixes than defined. Equal to `1000` if BGP session is terminated on hardware type of switch.
- **prefixlistinbound** (List of String) List of inbound prefix list. Example `["deny 127.0.0.0/8 le 32", "permit 0.0.0.0/0 le 24"]`.
Expand All @@ -71,3 +71,7 @@ resource "netris_bgp" "my-bgp" {
- **vnetid** (Number) Existing VNet service ID to terminate E-BGP on. Can't be used together `portid`.
- **weight** (Number) BGP session weight. Default value is `0`.
- **vpcid** (Number) ID of VPC. If not specified, the BGP will be created in the VPC marked as a default.
- **hellotimer** (Number) Hello timer is the frequency (seconds) of sending `Hello` messages. Default value is `3`.
- **holdtimer** (Number) Hold timer is the amount of time in seconds to keep BGP session up after the last received `Hello` message. This value must be at least 3 times bigger than `Hello` timer. Default value is `10`.
- **connecttimer** (Number) Connect timer is the amount of time in seconds which BGP waits between connection attempts to a neighbor. Default value is `10`.
- **bfd** (String) Valid value is `enabled` or `disabled`. Default value is `disabled`.
1 change: 1 addition & 0 deletions docs/resources/lag.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ resource "netris_lag" "lag1_switch-01" {
- **mtu** (Number) MTU must be integer between 68 and 9216. Default value is `9000`
- **lacp** (String) Configuring Link Aggregation Control Protocol (LACP) signaling for the current LAG Network Interface. Valid value is `on` or `off`. The default value is `off`.
- **extension** (Map of String) LAG Network Interface extension configurations
- **mclagid** (Number) Each MC-LAG requires an ID value in the range of `1-65535`, unique for the given switch-pair.
14 changes: 14 additions & 0 deletions docs/resources/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ resource "netris_link" "sg_to_sw" {
# "fc00::c82a:75ff:fe66:84b0/127",
# "fc00::c82a:75ff:fe66:84b1/127"
# ]
# mclag {
# sharedipv4addr = "198.51.100.50"
# anycastmacaddr = "44:38:39:ff:00:f0"
# }
depends_on = [netris_softgate.my-softgate, netris_switch.my-switch]
}
```
Expand All @@ -46,3 +50,13 @@ resource "netris_link" "sg_to_sw" {
- **ipv4** (List of String) List of two IPv4 addresses.

- **ipv6** (List of String) List of two IPv6 addresses.

- **mclag** (Block List) Block of MC-LAG. When specified, the link is marked for MC-LAG peer link. Multiple MC-LAG peer links between the same pair of switches must have the same MC-LAG IPv4 and MAC addresses. (see [below for nested schema](#nestedblock--mclag))

<a id="nestedblock--mclag"></a>
### Nested Schema for `mclag`

Required:
- **sharedipv4addr** (String) MC-LAG shared IPV4 address. Shall be part of any IPAM defined subnet with the purpose set to loopback

- **anycastmacaddr** (String) MC-LAG anycast MAC address. Recommended range 44:38:39:ff:00:00 - 44:38:39:ff:ff:ff
150 changes: 77 additions & 73 deletions examples/bgp_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ data "netris_network_interface" "swp13_sw2" {


resource "netris_bgp" "my-bgp-isp1" {
name = "my-bgp-isp1"
siteid = netris_site.santa-clara.id
hardware = "my-softgate01"
neighboras = 23456
portid = data.netris_network_interface.swp14_sw1.id
vlanid = 3000
localip = "172.19.25.2/30"
remoteip = "172.19.25.1/30"
description = "My ISP1 BGP"
inboundroutemap = netris_routemap.routemap-in.id
outboundroutemap = netris_routemap.routemap-out.id
localasn = "4294967295"
name = "my-bgp-isp1"
siteid = netris_site.santa-clara.id
# bfd = "enabled"
hardware = "my-softgate01"
neighboras = 23456
portid = data.netris_network_interface.swp14_sw1.id
vlanid = 3000
localip = "172.19.25.2/30"
remoteip = "172.19.25.1/30"
description = "My ISP1 BGP"
# inboundroutemap = netris_routemap.routemap-in.id
# outboundroutemap = netris_routemap.routemap-out.id
localasn = "4294967295"
hellotimer = 4
holdtimer = 12
connecttimer = 12
# state = "enabled"
# multihop = {
# neighboraddress = "185.54.21.5"
Expand All @@ -52,36 +56,36 @@ resource "netris_bgp" "my-bgp-isp1" {
depends_on = [netris_softgate.my-softgate01, netris_link.sg1_to_sw1]
}

resource "netris_bgp" "my-bgp-isp2" {
name = "my-bgp-isp2"
siteid = netris_site.santa-clara.id
hardware = "my-softgate02"
neighboras = 64600
portid = data.netris_network_interface.swp14_sw2.id
localip = "172.19.35.2/30"
remoteip = "172.19.35.1/30"
description = "My ISP2 BGP"
# inboundroutemap = netris_routemap.routemap-in.id
# outboundroutemap = netris_routemap.routemap-out.id
# state = "enabled"
# multihop = {
# neighboraddress = "185.54.21.5"
# updatesource = "198.51.100.11/32"
# hops = "5"
# }
# bgppassword = "somestrongpass"
# allowasin = 5
# defaultoriginate = false
# prefixinboundmax = 1000
# localpreference = 100
# weight = 0
# prependinbound = 2
prependoutbound = 2
prefixlistinbound = ["deny 127.0.0.0/8 le 32", "permit 0.0.0.0/0 le 24"]
prefixlistoutbound = ["permit 192.0.2.0/24", "permit 198.51.100.0/24 le 25", "permit 203.0.113.0/24 le 26"]
# sendbgpcommunity = ["65501:777"]
depends_on = [netris_softgate.my-softgate02, netris_link.sg2_to_sw2]
}
# resource "netris_bgp" "my-bgp-isp2" {
# name = "my-bgp-isp2"
# siteid = netris_site.santa-clara.id
# hardware = "my-softgate02"
# neighboras = 64600
# portid = data.netris_network_interface.swp14_sw2.id
# localip = "172.19.35.2/30"
# remoteip = "172.19.35.1/30"
# description = "My ISP2 BGP"
# # inboundroutemap = netris_routemap.routemap-in.id
# # outboundroutemap = netris_routemap.routemap-out.id
# # state = "enabled"
# # multihop = {
# # neighboraddress = "185.54.21.5"
# # updatesource = "198.51.100.11/32"
# # hops = "5"
# # }
# # bgppassword = "somestrongpass"
# # allowasin = 5
# # defaultoriginate = false
# # prefixinboundmax = 1000
# # localpreference = 100
# # weight = 0
# # prependinbound = 2
# prependoutbound = 2
# prefixlistinbound = ["deny 127.0.0.0/8 le 32", "permit 0.0.0.0/0 le 24"]
# prefixlistoutbound = ["permit 192.0.2.0/24", "permit 198.51.100.0/24 le 25", "permit 203.0.113.0/24 le 26"]
# # sendbgpcommunity = ["65501:777"]
# depends_on = [netris_softgate.my-softgate02, netris_link.sg2_to_sw2]
# }


resource "netris_bgp" "my-bgp-isp1-in-my-vpc" {
Expand Down Expand Up @@ -117,34 +121,34 @@ resource "netris_bgp" "my-bgp-isp1-in-my-vpc" {
depends_on = [netris_softgate.my-softgate01, netris_link.sg1_to_sw1]
}

resource "netris_bgp" "my-bgp-isp2-in-my-vpc" {
name = "my-bgp-isp2-in-my-vpc"
siteid = netris_site.santa-clara.id
hardware = "my-softgate02"
neighboras = 64600
portid = data.netris_network_interface.swp13_sw2.id
localip = "172.19.35.2/30"
remoteip = "172.19.35.1/30"
description = "My ISP2 BGP"
vpcid = netris_vpc.my-vpc.id
# inboundroutemap = netris_routemap.routemap-in.id
# outboundroutemap = netris_routemap.routemap-out.id
# state = "enabled"
# multihop = {
# neighboraddress = "185.54.21.5"
# updatesource = "198.51.100.11/32"
# hops = "5"
# }
# bgppassword = "somestrongpass"
# allowasin = 5
# defaultoriginate = false
# prefixinboundmax = 1000
# localpreference = 100
# weight = 0
# prependinbound = 2
prependoutbound = 2
prefixlistinbound = ["deny 127.0.0.0/8 le 32", "permit 0.0.0.0/0 le 24"]
prefixlistoutbound = ["permit 192.0.2.0/24", "permit 198.51.100.0/24 le 25", "permit 203.0.113.0/24 le 26"]
# sendbgpcommunity = ["65501:777"]
depends_on = [netris_softgate.my-softgate02, netris_link.sg2_to_sw2]
}
# resource "netris_bgp" "my-bgp-isp2-in-my-vpc" {
# name = "my-bgp-isp2-in-my-vpc"
# siteid = netris_site.santa-clara.id
# hardware = "my-softgate02"
# neighboras = 64600
# portid = data.netris_network_interface.swp13_sw2.id
# localip = "172.19.35.2/30"
# remoteip = "172.19.35.1/30"
# description = "My ISP2 BGP"
# vpcid = netris_vpc.my-vpc.id
# # inboundroutemap = netris_routemap.routemap-in.id
# # outboundroutemap = netris_routemap.routemap-out.id
# # state = "enabled"
# # multihop = {
# # neighboraddress = "185.54.21.5"
# # updatesource = "198.51.100.11/32"
# # hops = "5"
# # }
# # bgppassword = "somestrongpass"
# # allowasin = 5
# # defaultoriginate = false
# # prefixinboundmax = 1000
# # localpreference = 100
# # weight = 0
# # prependinbound = 2
# prependoutbound = 2
# prefixlistinbound = ["deny 127.0.0.0/8 le 32", "permit 0.0.0.0/0 le 24"]
# prefixlistoutbound = ["permit 192.0.2.0/24", "permit 198.51.100.0/24 le 25", "permit 203.0.113.0/24 le 26"]
# # sendbgpcommunity = ["65501:777"]
# depends_on = [netris_softgate.my-softgate02, netris_link.sg2_to_sw2]
# }
21 changes: 21 additions & 0 deletions examples/lag_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,24 @@ resource "netris_lag" "lag1-switch-01" {
netris_switch.my-switch01,
]
}

resource "netris_lag" "lag2-mc" {
description = "my mc-lag"
tenantid = data.netris_tenant.admin.id
mtu = 9008
# lacp = "on"
# extension = {
# extensionname = "ext1"
# vlanrange = "10-20"
# }
mclagid = 10
members = [
"swp10@my-switch01",
"swp10@my-switch02",
]
depends_on = [
netris_switch.my-switch01,
netris_switch.my-switch02,
netris_link.sw1_to_sw2_mc
]
}
13 changes: 13 additions & 0 deletions examples/link_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,16 @@ resource "netris_link" "srv2_to_sw2" {
# ]
depends_on = [netris_switch.my-switch02, netris_server.my-server02]
}


resource "netris_link" "sw1_to_sw2_mc" {
ports = [
"swp7@my-switch01",
"swp7@my-switch02"
]
mclag {
sharedipv4addr = "198.51.100.50"
anycastmacaddr = "44:38:39:ff:00:f0"
}
depends_on = [netris_switch.my-switch01, netris_switch.my-switch02]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d
github.com/netrisai/netriswebapi v0.0.0-20240911011151-253cf19362ec

)

Expand Down
20 changes: 20 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,26 @@ github.com/netrisai/netriswebapi v0.0.0-20240829015755-e99db53a40ef h1:PcFJ0n8O0
github.com/netrisai/netriswebapi v0.0.0-20240829015755-e99db53a40ef/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d h1:oioJ5wHmRe5k7O+I6Wi9H59VCtAMvV/t6SBqP0OKY38=
github.com/netrisai/netriswebapi v0.0.0-20240829195911-a229c1ed9c3d/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240909232127-74a86d170b1c h1:QHajZtqvIi8pDHmQqUNnoG0MI0sAxjvsojbxFO36eNA=
github.com/netrisai/netriswebapi v0.0.0-20240909232127-74a86d170b1c/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910003135-71e4eae006f7 h1:v9XciDZUh6T+G25yTcaC6qr5GksGtXIQsxLoffmI1c4=
github.com/netrisai/netriswebapi v0.0.0-20240910003135-71e4eae006f7/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910003745-397ddc45a432 h1:hi6XY7jWVwmBDr52keITSHgnAF7AoHJFpxxaAZtEg6A=
github.com/netrisai/netriswebapi v0.0.0-20240910003745-397ddc45a432/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910180536-2ccefe784368 h1:3jZux+FACSzKQItHl4wRDqgcJg9Lm4L0QaivJrDNVs4=
github.com/netrisai/netriswebapi v0.0.0-20240910180536-2ccefe784368/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910202445-971897c1c6e9 h1:NfqKm/S8gAeSdhNSBeZD+c+NSQyskOY4GIzkpNTiqhI=
github.com/netrisai/netriswebapi v0.0.0-20240910202445-971897c1c6e9/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910210619-0bd000b915ca h1:G11axnF3C5eDemmq3maCteH9GvTa8raWNU5/eDHYFMo=
github.com/netrisai/netriswebapi v0.0.0-20240910210619-0bd000b915ca/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240910211905-828527b092ad h1:cE0xXo5UoKnz7QfuEUyoSVl5EbjK9J7C68eIw+uxJ54=
github.com/netrisai/netriswebapi v0.0.0-20240910211905-828527b092ad/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240911002837-71d243c561dc h1:aG+G42hZwIfU09MYn1zWE7pTnGb2r0nhMHpFnYNNwiQ=
github.com/netrisai/netriswebapi v0.0.0-20240911002837-71d243c561dc/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240911005910-231574b8b167 h1:YUAPJejTvkppDl3YnKLfPVKH+4OKC4gW+R6SAeHmaX0=
github.com/netrisai/netriswebapi v0.0.0-20240911005910-231574b8b167/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20240911011151-253cf19362ec h1:DR66G/+tuf5WYJfitT911HgfVQvcTUWTFxam7vQ8buA=
github.com/netrisai/netriswebapi v0.0.0-20240911011151-253cf19362ec/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
Expand Down
Loading

0 comments on commit 5b0becf

Please sign in to comment.