Skip to content

Commit

Permalink
Configure SSM delivery (#7673)
Browse files Browse the repository at this point in the history
Co-authored-by: Abhinav Pandey <[email protected]>
  • Loading branch information
eks-distro-pr-bot and abhinavmpandey08 authored Feb 22, 2024
1 parent 12a1a9f commit 3b9f7b7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/pkg/ssm/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import (
"github.com/aws/eks-anywhere/pkg/retrier"
)

const ssmLogGroup = "/eks-anywhere/test/e2e"
const (
ssmLogGroup = "/eks-anywhere/test/e2e"
defaultSSMDeliveryTimeout = 300
)

var initE2EDirCommand = "mkdir -p /home/e2e/bin && cd /home/e2e"

Expand Down Expand Up @@ -127,9 +130,10 @@ func RunCommand(session *session.Session, logger logr.Logger, instanceID, comman

func sendCommand(service *ssm.SSM, logger logr.Logger, instanceID, command string, timeout time.Duration, opts ...CommandOpt) (*ssm.SendCommandOutput, error) {
in := &ssm.SendCommandInput{
DocumentName: aws.String("AWS-RunShellScript"),
InstanceIds: []*string{aws.String(instanceID)},
Parameters: map[string][]*string{"commands": {aws.String(initE2EDirCommand), aws.String(command)}, "executionTimeout": {aws.String(strconv.FormatFloat(timeout.Seconds(), 'f', 0, 64))}},
DocumentName: aws.String("AWS-RunShellScript"),
InstanceIds: []*string{aws.String(instanceID)},
Parameters: map[string][]*string{"commands": {aws.String(initE2EDirCommand), aws.String(command)}, "executionTimeout": {aws.String(strconv.FormatFloat(timeout.Seconds(), 'f', 0, 64))}},
TimeoutSeconds: aws.Int64(defaultSSMDeliveryTimeout),
}

for _, opt := range opts {
Expand Down

0 comments on commit 3b9f7b7

Please sign in to comment.