Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Helper: CIDR network #5227

Closed
phires opened this issue Dec 20, 2019 · 4 comments
Closed

Validation Helper: CIDR network #5227

phires opened this issue Dec 20, 2019 · 4 comments

Comments

@phires
Copy link
Contributor

phires commented Dec 20, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

Potentially all that are using the validators

Terraform Configuration Files

Debug Output

Panic Output

Expected Behavior

  • A CIDR value of 123.456.789.999/10 should be invalid
  • A CIDR value of 0.0.0.0 should be invalid, as it is not a valid CIDR notation without the network part

Actual Behavior

Above examples are valid

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@phires
Copy link
Contributor Author

phires commented Dec 20, 2019

There is a validator in go (net.ParseCIDR).
I would refactor these validation methods, although I'm not too sure of the implications of making an IP without network suffix (e.g. 0.0.0.0) failing the check.

@katbyte
Copy link
Collaborator

katbyte commented Dec 31, 2019

@phires, that would be a great change over the regex we currently use. You could make it an additional parameter or have multiple such as validate.CIDR and validate.CIDRAllowNoSuffix or validate.CIDRorIP

@favoretti
Copy link
Contributor

Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants