Skip to content

Commit

Permalink
adding a 10 sec connection timeout to the golang http client under SS…
Browse files Browse the repository at this point in the history
…M client

Signed-off-by: Min Jin <[email protected]>
  • Loading branch information
yue9944882 committed Jul 11, 2024
1 parent 2e5189a commit 76befa4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/ssm/ssm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
package ssm

import (
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
Expand Down Expand Up @@ -32,6 +34,9 @@ func NewClient(agentConfig *config.AgentConfig) Client {
awsConfig := aws.NewConfig().
WithRegion(agentConfig.Region).
WithCredentials(credentials.AnonymousCredentials)
if awsConfig.HTTPClient != nil {
awsConfig.HTTPClient.Timeout = time.Second * 10
}

if agentConfig.Endpoint != "" {
klog.Infof("overriding SSM endpoint to %s", agentConfig.Endpoint)
Expand Down

0 comments on commit 76befa4

Please sign in to comment.