Skip to content

Commit

Permalink
fix: #38 setup ssm client with shared configuration enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallear authored and tedsmitt committed Dec 29, 2023
1 parent 8ceb1d0 commit acc5ef1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ func (e *App) executeForward() error {
Target: aws.String(fmt.Sprintf("ecs:%s_%s_%s", e.cluster, taskID, *e.container.RuntimeId)),
}

mySession := session.Must(session.NewSession())
client := ssm.New(mySession, aws.NewConfig().WithRegion(e.region))
mySession := session.Must(session.NewSessionWithOptions(session.Options{
Config: aws.Config{Region: aws.String(region)},
Profile: viper.GetString("profile"),
SharedConfigState: session.SharedConfigEnable,
}))
client := ssm.New(mySession)
containerPort, err := getContainerPort(e.client, *e.task.TaskDefinitionArn, *e.container.Name)
if err != nil {
e.err <- err
Expand Down

0 comments on commit acc5ef1

Please sign in to comment.