Skip to content

Commit

Permalink
rename config.LoadDefaultAWSConfig to LoadDefaultConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdel authored and skmcgrail committed Sep 24, 2020
1 parent 193f64e commit e3a3dd8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func main() {
// Using the SDK's default configuration, loading additional config
// and credentials values from the environment variables, shared
// credentials, and shared configuration files
cfg, err := external.LoadDefaultAWSConfig()
cfg, err := external.LoadDefaultConfig()
if err != nil {
panic("unable to load SDK config, " + err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions aws/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
// The following example demonstrates using the AnonymousCredentials to prevent
// SDK's external config loading attempt to resolve credentials.
//
// cfg, err := config.LoadDefaultAWSConfig(
// cfg, err := config.LoadDefaultConfig(
// config.WithCredentialsProvider(aws.AnonymousCredentials{}))
// if err != nil {
// log.Fatalf("failed to load config, %v", err)
Expand All @@ -42,7 +42,7 @@ import (
//
// This can also be configured for specific operations calls too.
//
// cfg, err := config.LoadDefaultAWSConfig()
// cfg, err := config.LoadDefaultConfig()
// if err != nil {
// log.Fatalf("failed to load config, %v", err)
// }
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ func (cs Configs) ResolveConfig(f func(configs []interface{}) error) error {
return f(cfgs)
}

// LoadDefaultAWSConfig reads the SDK's default external configurations, and
// LoadDefaultConfig reads the SDK's default external configurations, and
// populates an AWS Config with the values from the external configurations.
//
// An optional variadic set of additional Config values can be provided as input
// that will be prepended to the Configs slice. Use this to add custom configuration.
// The custom configurations must satisfy the respective providers for their data
// or the custom data will be ignored by the resolvers and config loaders.
//
// cfg, err := config.LoadDefaultAWSConfig(
// cfg, err := config.LoadDefaultConfig(
// WithSharedConfigProfile("test-profile"),
// )
// if err != nil {
Expand All @@ -135,7 +135,7 @@ func (cs Configs) ResolveConfig(f func(configs []interface{}) error) error {
// The default configuration sources are:
// * Environment Variables
// * Shared Configuration and Shared Credentials files.
func LoadDefaultAWSConfig(configs ...Config) (aws.Config, error) {
func LoadDefaultConfig(configs ...Config) (aws.Config, error) {
var cfgs Configs
cfgs = append(cfgs, configs...)

Expand Down
4 changes: 2 additions & 2 deletions config/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func ExampleWithSharedConfigProfile() {
cfg, err := config.LoadDefaultAWSConfig(
cfg, err := config.LoadDefaultConfig(
// Specify the shared configuration profile to load.
config.WithSharedConfigProfile("exampleProfile"),

Expand All @@ -35,7 +35,7 @@ func ExampleWithSharedConfigProfile() {
}

func ExampleWithCredentialsProvider() {
cfg, err := config.LoadDefaultAWSConfig(
cfg, err := config.LoadDefaultConfig(
// Hard coded credentials.
config.WithCredentialsProvider{
CredentialsProvider: credentials.StaticCredentialsProvider{
Expand Down
12 changes: 6 additions & 6 deletions config/resolve_processcreds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestProcessCredentialsProvider_FromConfig(t *testing.T) {
setupEnvForProcesscredsConfigFile()
os.Setenv("AWS_SDK_LOAD_CONFIG", "1")

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestProcessCredentialsProvider_FromConfigWithProfile(t *testing.T) {
os.Setenv("AWS_PROFILE", "not_expire")
setupEnvForProcesscredsConfigFile()

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand All @@ -91,7 +91,7 @@ func TestProcessCredentialsProvider_FromConfigWithStaticCreds(t *testing.T) {
os.Setenv("AWS_PROFILE", "not_alone")
setupEnvForProcesscredsConfigFile()

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand All @@ -117,7 +117,7 @@ func TestProcessCredentialsProvider_FromCredentials(t *testing.T) {

setupEnvForProcesscredsCredentialsFile()

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestProcessCredentialsProvider_FromCredentialsWithProfile(t *testing.T) {
os.Setenv("AWS_PROFILE", "non_expire")
setupEnvForProcesscredsCredentialsFile()

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand All @@ -171,7 +171,7 @@ func TestProcessCredentialsProvider_FromCredentialsWithStaticCreds(t *testing.T)
os.Setenv("AWS_PROFILE", "not_alone")
setupEnvForProcesscredsCredentialsFile()

config, err := LoadDefaultAWSConfig(WithRegion("region"))
config, err := LoadDefaultConfig(WithRegion("region"))
if err != nil {
t.Fatalf("error loading default config: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion credentials/processcreds/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ retrieve credentials. NOTE: If there are credentials in the profile you are
using, the credential process will not be used.
// Initialize a session to load credentials.
cfg, _ := config.LoadDefaultAWSConfig()
cfg, _ := config.LoadDefaultConfig()
// Create S3 service client to use the credentials.
svc := s3.NewFromConfig(cfg)
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SDK's Amazon DynamoDB client.
// Using the SDK's default configuration, loading additional config
// and credentials values from the environment variables, shared
// credentials, and shared configuration files
cfg, err := config.LoadDefaultAWSConfig()
cfg, err := config.LoadDefaultConfig()
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion service/dynamodb/internal/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestMain(m *testing.M) {
}

func TestInteg_ClientScan(t *testing.T) {
cfg, err := config.LoadDefaultAWSConfig()
cfg, err := config.LoadDefaultConfig()
if err != nil {
log.Fatalf("failed to load config, %v", err)
}
Expand Down

0 comments on commit e3a3dd8

Please sign in to comment.