Skip to content

Maintenance: boto client default configuration is not used enough #814

@jericht

Description

@jericht

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:

  1. We have a couple places where we manage boto clients like:
  2. 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 deadline client 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceChanges to builds, tests, processes, or code that does not directly affect functionalitywontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions