-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Description
It would be great to be able to apply common boto configurations in one spot in the code that would take effect for boto clients created everywhere in this package. We have started a pattern where we have a default boto client config, however its not applied everywhere (or at least in most spots) in the code.
Couple struggles I found trying to add a common config option:
- We have a couple places where we manage boto clients like:
- We also have the ability to create a boto session and create clients with that, which would not have the default config applied. There are cases where not using the default config could be desired, but I see cases where a default client config would be totally fine (e.g. creating a
deadlineclient and calling GetQueue to download job output).
Context:
In a recent PR (#812), I made a change to apply use special click Group/Command classes that would add the CLI command name to user agent headers in our requests made with boto, however I realized not all boto clients are created using the default config.
Solution
We could refactor the boto session/client management into one module and do it in a way that the default client config is used unless the caller explicitly requests not to use the default.
If there is another way (e.g. if we can hook into boto to apply common configurations to clients everywhere), that works too and would probably be a lot less work.