diff --git a/azurerm/helpers/validate/network.go b/azurerm/helpers/validate/network.go index 99a88e2d841e..390d5721f679 100644 --- a/azurerm/helpers/validate/network.go +++ b/azurerm/helpers/validate/network.go @@ -53,7 +53,7 @@ func PortNumber(i interface{}, k string) (_ []string, errors []error) { return } - if v < 0 || 65535 < v { + if v < 1 || 65535 < v { errors = append(errors, fmt.Errorf("%q is not a valid port number: %q", k, i)) } diff --git a/azurerm/helpers/validate/network_test.go b/azurerm/helpers/validate/network_test.go index 56cbe62eacd4..b2e91fdd7bb5 100644 --- a/azurerm/helpers/validate/network_test.go +++ b/azurerm/helpers/validate/network_test.go @@ -162,7 +162,7 @@ func TestPortNumber(t *testing.T) { }, { Port: 0, - Errors: 0, + Errors: 1, }, { Port: 1,