diff --git a/Makefile b/Makefile index fce57db..40efa08 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io NAMESPACE=netrisai NAME=netris BINARY=terraform-provider-${NAME} -VERSION=3.4.0 +VERSION=3.4.1 OS_ARCH=darwin_arm64 WORKDIRECTORY=examples diff --git a/docs/resources/network_interface.md b/docs/resources/network_interface.md index a0eea43..1e7f3eb 100644 --- a/docs/resources/network_interface.md +++ b/docs/resources/network_interface.md @@ -47,7 +47,7 @@ resource "netris_network_interface" "swp10_my-switch" { ### Optional - **autoneg** (String) Toggle auto negotiation. Possible values: `default`, `on`, `off`. Default value is `default` -- **breakout** (String) Toggle breakout. Possible values: `off`, `4x10`, `4x25`, `4x100`, `manual`. Default value is `off` +- **breakout** (String) Toggle breakout. Possible values: `off`, `disabled`, `4x10`, `4x25`, `2x50`, `4x50`, `2x100`, `4x100`, `2x200`, `4x200`, `2x400`. Default value is `off`. - **description** (String) Network Interface desired description - **extension** (Map of String) Network Interface extension configurations. - **mtu** (Number) MTU must be integer between 68 and 9216. Default value is `9000` diff --git a/netris/networkinterface/validate.go b/netris/networkinterface/validate.go index a05abae..7d4554e 100644 --- a/netris/networkinterface/validate.go +++ b/netris/networkinterface/validate.go @@ -25,10 +25,21 @@ import ( func validateBreakout(val interface{}, key string) (warns []string, errs []error) { v := val.(string) - if !(v == "off" || v == "4x10" || v == "4x25" || v == "4x100" || v == "manual") { - errs = append(errs, fmt.Errorf("Breakout available values are (off, 4x10, 4x25, 4x100, manual)")) - return warns, errs + allowedValues := []string{"off", "disabled", "4x10", "4x25", "2x50", "4x50", "2x100", "4x100", "2x200", "4x200", "2x400"} + + // Check if the provided value is in the list of allowed values + isValid := false + for _, allowedValue := range allowedValues { + if v == allowedValue { + isValid = true + break + } } + + if !isValid { + errs = append(errs, fmt.Errorf("Breakout available values are %v", allowedValues)) + } + return warns, errs } diff --git a/netris/sw/sw.go b/netris/sw/sw.go index f4f90c1..3a04f23 100644 --- a/netris/sw/sw.go +++ b/netris/sw/sw.go @@ -88,6 +88,7 @@ func Resource() *schema.Resource { Type: schema.TypeInt, Required: true, Description: "Preliminary port count is used for definition of topology. Possible values: `16`, `32`, `48`, `54`, `56`, `64`", + ForceNew: true, }, "breakout": { Type: schema.TypeString,