Error Details from AWS Example -
VPC Range as "10.0.0.0/24" with the subnet range as "10.0.38.0/24".So it should throw an alert as shown in image.
Error Details from AWS Example -
VPC Range as "10.0.0.0/24" with the subnet range as "10.0.38.0/24".So it should throw an alert as shown in image.
One first idea would be something like this:
vpc='10.0.0.0/24'
range='10.0.0.28/24'
rangeParts=range.split('.')
vpc.split('.')
.map((value, index) => index >= 3 || value === rangeParts[index])
.reduce((last, next) => last && next, true)
It basically compares the first 3 values to be equal. Would not recommend to use this in production, as there are probably cleaner solutions