Skip to content

Commit c63e866

Browse files
authored
fix: use the common func for loading aws creds that properly does rol… (#49)
* fix: use the common func for loading aws creds that properly does role chaining * chore: remove unused dep
1 parent bb8c768 commit c63e866

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/ctrlc/root/sync/aws/networks/networks.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/MakeNowJust/heredoc/v2"
1111
"github.com/aws/aws-sdk-go-v2/aws"
12-
"github.com/aws/aws-sdk-go-v2/config"
1312
"github.com/aws/aws-sdk-go-v2/service/ec2"
1413
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
1514
"github.com/charmbracelet/log"
@@ -144,7 +143,7 @@ func runSync(regions *[]string, name *string) func(cmd *cobra.Command, args []st
144143

145144
// initComputeClient creates a new Compute Engine client
146145
func initComputeClient(ctx context.Context, region string) (*ec2.Client, aws.Config, error) {
147-
cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(region))
146+
cfg, err := common.InitAWSConfig(ctx, region)
148147
if err != nil {
149148
return nil, cfg, fmt.Errorf("failed to load AWS config: %w", err)
150149
}

0 commit comments

Comments
 (0)