ec2.py with boto profiles

Hi,

Are there any plans to update ec2.py so boto profiles can be used where we have multiple aws accounts?

We currently use both awscli and boto using profiles to connection the appropriate credentials. I’ve seen the various ec2 modules now have a ‘profile’ parameter to enable use of boto profiles, but as far as I can tell, ec2.py doesn’t allow for such an option and just relies on boto’s default order of precedence for authentication credentials (falling to the credentials used when no profile parameter is passed).

In the situation where people have multiple aws accounts, how are you using ec2.py for dynamic inventory?

Thanks.

There’s a pull request for this in the queue, though you could also include your inventories in seperate directories and have different copies of the INI file as a workaround.

(Or use Ansible Tower, which features some very nice graphical inventory sync capabiliies with EC2 – not trying to oversell it, but it’s there, and well done, and can say “only people in team X can deploy to this cloud”, etc, which can be nice)

Thanks for the reply. I look forward to the version supporting profiles.

As for the workaround, I’m probably just missing something, but I don’t see anything in the ini file that suggests having credentials in there. We need to use different credentials for every AWS account.

Yeah I’m sorry about this one, it uses env vars as is, not settable in the INI file.

Tower solves this by syncing inventory to seperate database groups, so multiple ec2 inventory sources can be mapped to either different inventories or different groups, as you would want.

Merging the boto profile one should provide this feature for you.