timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
424 stars 123 forks source link

revoke: The parameter GroupName is not recognized #103

Closed icy closed 8 years ago

icy commented 8 years ago

When the port number is -1 , the revoke command can't correctly handle user input.

$ ./bin/aws.pl revoke -i "sg-xxx"  -e -P icmp -p -1 -s 10.0.0.0/24 -v
aws versions: (ec2: 2013-10-15, sqs: 2012-11-05, elb: 2011-11-15,

 sdb: 2009-04-15, iam: 2010-05-08, ebn: 2010-12-01, cfn: 2010-05-15, rds: 2013-09-09)

ec2(Action, RevokeSecurityGroupEgress, GroupId, sg-6d1b1209, 
IpPermissions.1.IpProtocol, icmp, IpPermissions.1.FromPort, ,
 IpPermissions.1.ToPort, s, GroupName, 10.0.0.0/24)

---
:Errors:
  :Error:
    :Code: "UnknownParameter"
    :Message: "The parameter GroupName is not recognized"

The same input works with auth command.

$ ./bin/aws.pl auth -i "sg-xxx"  -e -P icmp -p -1 -s 10.0.0.0/24 -v
aws versions: (ec2: 2013-10-15, sqs: 2012-11-05, elb: 2011-11-15, 
sdb: 2009-04-15, iam: 2010-05-08, ebn: 2010-12-01, cfn: 2010-05-15, rds: 2013-09-09)

ec2(Action, AuthorizeSecurityGroupEgress, GroupId, sg-6d1b1209,
 IpPermissions.1.IpProtocol, icmp, IpPermissions.1.FromPort, -1,
 IpPermissions.1.ToPort, -1, IpPermissions.1.IpRanges.1.CidrIp, 10.0.0.0/24)

---
:Errors:
  :Error:
    :Code: "InvalidPermission.Duplicate"
    :Message: "the specified rule "peer: 10.0.0.0/24, 
ICMP, type: ALL, code: ALL, ALLOW" already exists"
icy commented 8 years ago

Also note that when the port is not -1, both commands (auth and revoke) works as usual

icy commented 8 years ago

Fixed in #104