Search code examples
amazon-web-servicesaws-cli

How to add description for inbound rule with AWS CLI?


I can create new inbound rule by using following command:

aws ec2 authorize-security-group-ingress --group-id sg-00b417024c6afddae --protocol tcp --port 5000 --cidr  0.0.0.0/0

How can I add the description to that rule?


Solution

  • You have to use full notation with --ip-permissions:

    aws ec2 authorize-security-group-ingress --group-id sg-00b417024c6afddae --ip-permissions FromPort=5000,ToPort=5000,IpProtocol=tcp,IpRanges='[{CidrIp=0.0.0.0/0,Description=mydescription}]'