Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CIDR block is malformed. What is wrong with this CLI command?

I want to set up an IP address for a security group with CLI. But for some reason AWS throws an error. And the value is just absolutely correct because I'm setting the same value as set there at the time of command execution. What is wrong? Why is this error?

$ aws ec2 authorize-security-group-ingress --protocol tcp --port 22 --cidr 'xx.xx.xxx.xx/32' --group-id sg-xxxxxxxx

An error occurred (InvalidParameterValue) when calling the AuthorizeSecurityGroupIngress operation: CIDR block xx.xx.xxx.xx\32 is malformed
like image 962
Green Avatar asked Nov 08 '22 06:11

Green


1 Answers

Your command worked perfectly well for me (substituting an IP address and a security group).

You might want to try it without the single-quotes.

Also, the error with a backslash (CIDR block xx.xx.xxx.xx\32 is malformed) is a little concerning, as if it has converted your input. I receive exactly the same error if I use a backslash (\) instead of a forward slash (/).

like image 168
John Rotenstein Avatar answered Nov 14 '22 20:11

John Rotenstein