scaleway / scaleway-sdk-go

Integrate Scaleway with your Go application

Home Page:https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusing limitations on private subnets size

foretspaisibles opened this issue · comments

Valid IPv4 subnets have confusing and apparently undocumented limitations. The error shows up while using Terraform provider but since it is not caught by the provider itself, I believe it is actually an error in the SDK.

For instance attempting to create the following VPC, results in an error:

resource "scaleway_vpc_private_network" "main" {
  name = "private-network"
  tags = ["GitHub-issue"]

  ipv4_subnet {
    subnet = "192.168.0.0/16"
  }
}

The message is

Error: scaleway-sdk-go: invalid argument(s): subnets[0] is invalid for unexpected reason, prefix: {"max": 20, "min": 29}

It is helpful because it explains how to solve the issue, yet in a not so straightforward way. It is confusing because there is no reference to this in Terraform provider documentation nor in SDK documentation. Another source of confusion is that the reserved IP addresses listed by IETF mentions 192.168.0.0/16.

As a Scaleway user I would love to see:

  1. A mention about these limitations in documentation (provider, sdk)
  2. A straightforward message explaining how to resolve the issue, which uses words and concepts based on user intent (CIDR, IPs, mask length) rather than relating to deserialisation artefacts from the CIDR notation.
  3. A link to said documentation in the error message.

Using terraform provider 2.26.0