Skip to content

Commit 5a044c3

Browse files
committed
Add profile option for AWS
1 parent 87b69eb commit 5a044c3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmd/sync/aws.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func (client *AWSClient) GetUpstreams() []Upstream {
8585
func (client *AWSClient) configure() error {
8686
httpClient := &http.Client{Timeout: connTimeoutInSecs * time.Second}
8787

88-
cfg, err := config.LoadDefaultConfig(context.TODO())
88+
cfg, err := config.LoadDefaultConfig(context.TODO(),
89+
config.WithSharedConfigProfile(client.config.Profile),
90+
)
8991
if err != nil {
9092
return err
9193
}
@@ -241,9 +243,9 @@ func prepareBatches(maxItems int, items []string) [][]string {
241243
}
242244

243245
// Configuration for AWS Cloud Provider
244-
245246
type awsConfig struct {
246247
Region string
248+
Profile string
247249
Upstreams []awsUpstream
248250
}
249251

cmd/sync/aws_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func getValidAWSConfig() *awsConfig {
2222
cfg := awsConfig{
2323
Region: "us-west-2",
2424
Upstreams: upstreams,
25+
Profile: "default",
2526
}
2627

2728
return &cfg

0 commit comments

Comments
 (0)