Skip to content

Commit 3b85f21

Browse files
committed
Add profile option for AWS
1 parent 13474fa commit 3b85f21

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cmd/sync/aws.go

+5-3
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 fmt.Errorf("unable to load default AWS config: %w", err)
9193
}
@@ -239,10 +241,10 @@ func prepareBatches(maxItems int, items []string) [][]string {
239241
return batches
240242
}
241243

242-
// Configuration for AWS Cloud Provider
243-
244+
// Configuration for AWS Cloud Provider.
244245
type awsConfig struct {
245246
Region string `yaml:"region"`
247+
Profile string `yaml:"profile"`
246248
Upstreams []awsUpstream `yaml:"upstreams"`
247249
}
248250

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)