EC2: Security Group Peer CIDR validation #3639
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
feature-request
A feature should be added or improved.
Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce
Peer.ipv4
andPeer.ipv6
do not throw when given an invalid CIDR block. The error only happens when deploying the stack.What is the expected behavior (or behavior of feature suggested)?
The parameter should be regex matched, and an error should be thrown if the provided parameter is not a valid CIDR. Ideally, the CDK could also match a plain IP without the mask, and throw a different error, suggesting adding it, e.g.
did you mean 0.0.0.0/0, or 255.255.255.255/24?
.What is the motivation / use case for changing the behavior or adding this feature?
The naming of the
Peer.ipv4/v6
methods is misleading, and I keep forgetting that the parameter must be a CIDR.Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: