Boto and aws-cli users write ini-style config in one or more files (e.g. ~/.aws/config) under a series of different profiles. I am writing a library which wraps boto API calls, but I would like to change its behavior based on the user's active profile settings (i.e. AWS_PROFILE and friends).
How does one programmatically retrieve the effective user's profile settings (i.e. boto defaults, overridden with the user's profile settings, overridden by whatever environment variable have precedence). I am particularly interested in the "region" key of the profile, but I suspect the procedure would be similar for other keys.
Another way of phrasing this, would be: is there a boto API call (or series of calls) that will retrieve the "currently active / effective" settings for a given boto Session?
As a counterexample: A very crude, brittle, and incorrect way to extract the user's region settings would to inspect the environment AWS_PROFILE, look for ~.aws/config, and parse the key "region" out of it. I'd rather let boto apply its own rules, and extract the result.