File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ package main
16
16
import (
17
17
"context"
18
18
"fmt"
19
- "github.com/aws/aws-sdk-go-v2/config"
20
19
"log"
21
20
"os"
22
21
"os/signal"
@@ -31,6 +30,8 @@ import (
31
30
"github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector"
32
31
"github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs"
33
32
"github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter"
33
+ "github.com/aws/aws-sdk-go-v2/aws"
34
+ "github.com/aws/aws-sdk-go-v2/config"
34
35
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
35
36
tea "github.com/charmbracelet/bubbletea"
36
37
"github.com/spf13/cobra"
@@ -247,7 +248,18 @@ Full docs can be found at github.com/aws/amazon-` + binName
247
248
}
248
249
249
250
ctx := context .Background ()
250
- cfg , err := config .LoadDefaultConfig (ctx )
251
+ cfg , err := config .LoadDefaultConfig (ctx ,
252
+ config .WithSharedConfigProfile (
253
+ aws .ToString (
254
+ cli .StringMe (flags [profile ]),
255
+ ),
256
+ ),
257
+ config .WithRegion (
258
+ aws .ToString (
259
+ cli .StringMe (flags [region ]),
260
+ ),
261
+ ),
262
+ )
251
263
if err != nil {
252
264
fmt .Printf ("Failed to load default AWS configuration: %s\n " , err .Error ())
253
265
os .Exit (1 )
You can’t perform that action at this time.
0 commit comments