aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

authorize-security-group-ingress not working in vpc

Open awesomescot-zz opened this issue 12 years ago • 1 comments

Maybe I'm doing something wrong here, but when I run this:

$ aws ec2 authorize-security-group-ingress --group-id sg-e7a6eb82 --protocol tcp --port 3306 --source-security-group-owner-id sg-1ea6eb7b

I get this response:

{
     "return": "true"
}

But when I check the group, I see no change:

$ aws ec2 describe-security-groups --group-ids sg-e7a6eb82
{
    "SecurityGroups": [
        {
            "IpPermissionsEgress": [
                {
                    "IpProtocol": "-1", 
                    "IpRanges": [
                        {
                            "CidrIp": "0.0.0.0/0"
                        }
                    ], 
                    "UserIdGroupPairs": []
                }
            ], 
            "Description": "staging mysql group", 
            "IpPermissions": [], 
            "GroupName": "stg-mysql", 
            "VpcId": "vpc-fa30939f", 
            "OwnerId": "080487575573", 
            "GroupId": "sg-e7a6eb82"
        }
    ]
}

Is this a bug, or am I being an idiot? Let me know if I can provide more information. Thanks in advance.

awesomescot-zz avatar Aug 06 '14 18:08 awesomescot-zz

Ah, I was kind of being an idiot. But the documentation is also very poor, so maybe this issue can go towards improving the documentation at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html. I got it working with this command:

aws ec2 authorize-security-group-ingress --group-id sg-e7a6eb82 --protocol tcp --port 3306 --source-group sg-1ea6eb7

But from reading the docs which say

--source-group (string)
    The name of the source security group. Cannot be used when specifying a CIDR IP address.

This should instead say something like The name or id of the source security group. And the entry for --source-security-group-owner-id

--source-security-group-owner-id (string)
    The ID of the source security group. You can't specify a source security group and a CIDR IP address range.

Should instead say something like The ID of the owner of the source security group.

awesomescot-zz avatar Aug 06 '14 18:08 awesomescot-zz