I have created a security group in AWS. I have added the ingress rule using the below command

aws ec2 authorize-security-group-ingress --group-id sg-07xxxx4d --ip-protocol tcp --from-port 22 --to-port 22 --cidr-ip

But instead of IP, if i want to give the source as another existing security group, how can i do that?

1 Answer 1


Ok I got the answer after exploring few things and looking at the error more attentively. Here is the way:

aws ec2 authorize-security-group-ingress --group-id sg-07xxxx24d  --protocol tcp --port 22 --source-group sg-d7dyyyy5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.