boto/boto — pull request #1048 by marknca (2012-10-12 02:30:20+00:00)
Title: EC2 ELB listeners now support InstanceProtocol without breaking existing syntax

In response to [open pull #562](https://github.com/boto/boto/pull/562), I've implemented the InstanceProtocol in the ELB listeners without breaking the existing syntax.

This isn't the cleanest implementation if we were starting today but it is a solid solution that maintains backwards compatibility given the design choices that were made with the existing code.

When creating a load balancer or listener, the **listeners** argument is now optional. I've added a **complex_listeners** argument at the end of the function definition that handles a longer tuple.

The existing **listeners** argument is a list of tuples 3-4 items in length. The **complex_listeners** argument accepts a list of tuples 4-5 items in length. You can use both arguments at the same time but at least one is required.

This pull request now allows users to create listeners that are HTTPS <> HTTPS instead of the default HTTPS <> HTTP when HTTPS is specified as the protocol.

```python
# existing listener tuple
(port, instance_port, protocol, ssl_id)

# complex listener tuple
(port, instance_port, protocol, instance_protocol, ssl_id)
```

Suggestions are welcome but this seemed the most elegant solution given the existing constraints.