Skip to content

Commit

Permalink
prevent call to ssm:SendCommand with 0 instances
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Dec 20, 2024
1 parent b534b5b commit 119ec30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/srv/server/ssm_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ func (si *SSMInstaller) Run(ctx context.Context, req SSMRunRequest) error {
validInstances = instancesState.valid
}

if len(validInstances) == 0 {
return nil
}

validInstanceIDs := instanceIDsFrom(validInstances)
output, err := req.SSM.SendCommand(ctx, &ssm.SendCommandInput{
DocumentName: aws.String(req.DocumentName),
Expand Down

0 comments on commit 119ec30

Please sign in to comment.