AWS Security Group Creation Using AWS CLI 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 0.0.0.0/0


But instead of IP, if i want to give the source as another existing security group, how can i do that?
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