You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v2 SDK's design for LoadDefaultConfig options are very generic, and will accept any value since Config is an alias for interface{}. This means there are no direct links between the configuration loading utility and the options a user can provide. Other than looking for With... types/functions in the config module. In addition, since Config is an empty interface, users could provide any value here regardless if it is valid and usable or not.
To address these issues, I propose the config.LoadDefaultConfig function signature be changed to take function options for a LoadOptions struct instead of abstract Config empty interface type. Instead of LoadDefaultConfig taking an abstract set of configuration provider getters, LoadDefaultConfig would take functional options of a discrete set of options that are valid for loading the configuration. Helpers like WithRegion, WithSharedConfigProfile, etc would be functional options that set fields on the LoadOptions struct instead of value getters.
The embedded aws.Config allows configuration of default configuration options such as Region, and EndpointResolver. the value of the embedded aws.Config would be initialized with the config's current resolveDefaultConfig function before the user provided option functions are invoked. This design also removes the needed for resolvers like resolveEndpointResolvers, resolveRegion, and resolveHTTPClient.
The LoadOptions type would implement the provider getters that are used by the config loading resolvers.
The text was updated successfully, but these errors were encountered:
resolveRegion resolver would still need to exist, since region can come from additional sources, such as environment variables and shared config. In addition to ec2 region if the SDK ever supports that.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
The v2 SDK's design for
LoadDefaultConfig
options are very generic, and will accept any value sinceConfig
is an alias forinterface{}
. This means there are no direct links between the configuration loading utility and the options a user can provide. Other than looking forWith...
types/functions in theconfig
module. In addition, sinceConfig
is an empty interface, users could provide any value here regardless if it is valid and usable or not.To address these issues, I propose the
config.LoadDefaultConfig
function signature be changed to take function options for aLoadOptions
struct instead of abstractConfig
empty interface type. Instead of LoadDefaultConfig taking an abstract set of configuration provider getters, LoadDefaultConfig would take functional options of a discrete set of options that are valid for loading the configuration. Helpers likeWithRegion
,WithSharedConfigProfile
, etc would be functional options that set fields on theLoadOptions
struct instead of value getters.Usage:
config Package type definitions:
The embedded
aws.Config
allows configuration of default configuration options such as Region, and EndpointResolver. the value of the embeddedaws.Config
would be initialized with the config's currentresolveDefaultConfig
function before the user provided option functions are invoked. This design also removes the needed for resolvers likeresolveEndpointResolvers
,resolveRegion
, andresolveHTTPClient
.The
LoadOptions
type would implement the provider getters that are used by the config loading resolvers.The text was updated successfully, but these errors were encountered: