# ec2\_group with port range?

**URL:** <https://forum.ansible.com/t/ec2-group-with-port-range/14992>\
**Category:** Ansible Project\
**Created:** [April 11, 2014, 12:01am UTC](https://forum.ansible.com/t/ec2-group-with-port-range/14992 "2014-04-11T00:01:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghexsel](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@ghexsel](https://forum.ansible.com/u/ghexsel)\
**Post date:** [April 11, 2014, 12:01am UTC](https://forum.ansible.com/t/ec2-group-with-port-range/14992/1 "2014-04-11T00:01:47Z")

</div>

Is there a way to define an ec2\_group with port ranges, or maybe allow all ports for the security group? There is one example with a protocol of “all” which the code seems to map to -1, but if I use it, I get the following:

…

boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request

…  
`InvalidPermission.Malformed`Unsupported IP protocol “-1” - supported: [tcp, udp, icmp]  
…

I also tried to define the ports as None (which the code seemed to be doing for that “all” protocol, but I got a  
…  
`InvalidParameterValue`Invalid integer value None

…

Is there a work-around?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 15, 2014, 9:02pm UTC](https://forum.ansible.com/t/ec2-group-with-port-range/14992/2 "2014-04-15T21:02:39Z")

</div>

Saw you opened an RFE on this one: [https://github.com/ansible/ansible/issues/6903](https://github.com/ansible/ansible/issues/6903)

Not sure the API supports this or not – any users of this know?

---

<div class="post-metadata">

**Author:** ![ghexsel](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@ghexsel](https://forum.ansible.com/u/ghexsel)\
**Post date:** [April 16, 2014, 2:03am UTC](https://forum.ansible.com/t/ec2-group-with-port-range/14992/3 "2014-04-16T02:03:45Z")

</div>

Not sure if it matters, but the ec2\_group help page does mention an “all” setting, it just doesn’t seem to be working.
