philipforget/awsssh — pull request #1 by philipforget (2014-10-10 20:33:06+00:00)
Title: basic filter support

Every EC2 instances does not necessarily have a Name tag to use as the SSH config's Host value. This PR provides the ability to specify which attribute of the EC2 instance to use as the Host value by way of a host_format string. This string will be formatted by passing the EC2 instance's `__dict__` property which means that any properties of the instance can be used in the host_format. For example:

```python
fake_ec2__dict__ = {
"id": "i-630c956c"
}

# Passed from config as the host_format property
host_format = "project-foo-{id}"

host_format.format(**fake_ec2_dict)
# > "project-foo-i-630c956c"
# Will be used like so
# Host project-foo-i-630c956c
# HostName ...
```

Instances may not have a public_dns_name, so you can now specify which instance property to use to set the HostName config with the `hostname_key` property in the config.

This PR also provides the ability to provide arbitrary filters to be passed to boto's `get_all_instances` commands from the config file. These are specific to each config entry and are passed by the `filter` property of the config entries.