Skip to content

Commit 99a8721

Browse files
authored
Merge pull request #85 from bottlerocket-os/ssm-wait-stuck
Added timeout seconds for ssm command
2 parents a05f602 + 6792fa0 commit 99a8721

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

updater/aws.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const (
2222
updateStateReady = "Ready"
2323
waiterDelay = time.Duration(15) * time.Second
2424
waiterMaxAttempts = 100
25+
// If this time is reached and the ssm command has not already started running, it will not run.
26+
deliveryTimeoutSeconds = 600
2527
)
2628

2729
type instance struct {
@@ -296,6 +298,7 @@ func (u *updater) updateInstance(inst instance) error {
296298
DocumentName: aws.String(u.rebootDocument),
297299
DocumentVersion: aws.String("$DEFAULT"),
298300
InstanceIds: aws.StringSlice(ec2IDs),
301+
TimeoutSeconds: aws.Int64(deliveryTimeoutSeconds),
299302
})
300303
if err != nil {
301304
return fmt.Errorf("failed to send reboot command: %w", err)
@@ -351,6 +354,7 @@ func (u *updater) sendCommand(instanceIDs []string, ssmDocument string) (string,
351354
DocumentName: aws.String(ssmDocument),
352355
DocumentVersion: aws.String("$DEFAULT"),
353356
InstanceIds: aws.StringSlice(instanceIDs),
357+
TimeoutSeconds: aws.Int64(deliveryTimeoutSeconds),
354358
})
355359
if err != nil {
356360
return "", fmt.Errorf("send command failed: %w", err)

0 commit comments

Comments
 (0)