Skip to content

Commit

Permalink
uncomment load default config, add config replace statement
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita committed Oct 25, 2023
1 parent 4d7492b commit 54bcc53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
48 changes: 24 additions & 24 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,30 +174,30 @@ func (cs configs) ResolveConfig(f func(configs []interface{}) error) error {
// The default configuration sources are:
// * Environment Variables
// * Shared Configuration and Shared Credentials files.
// func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) {
// fmt.Println("calling config.LoadDefaultConfig")
// var options LoadOptions
// for _, optFn := range optFns {
// if err := optFn(&options); err != nil {
// return aws.Config{}, err
// }
// }

// // assign Load Options to configs
// var cfgCpy = configs{options}

// cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options))
// if err != nil {
// return aws.Config{}, err
// }

// cfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers)
// if err != nil {
// return aws.Config{}, err
// }

// return cfg, nil
// }
func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) {
fmt.Println("calling config.LoadDefaultConfig")
var options LoadOptions
for _, optFn := range optFns {
if err := optFn(&options); err != nil {
return aws.Config{}, err
}
}

// assign Load Options to configs
var cfgCpy = configs{options}

cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options))
if err != nil {
return aws.Config{}, err
}

cfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers)
if err != nil {
return aws.Config{}, err
}

return cfg, nil
}

func resolveConfigLoaders(options *LoadOptions) []loader {
fmt.Println("calling config.resolveConfigLoaders")
Expand Down
2 changes: 2 additions & 0 deletions service/elasticbeanstalk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ require (

replace github.com/aws/aws-sdk-go-v2 => ../../

replace github.com/aws/aws-sdk-go-v2/config => ../../config

replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/

replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/

0 comments on commit 54bcc53

Please sign in to comment.