diff --git a/run.go b/run.go index 99c25d2..a6ed230 100644 --- a/run.go +++ b/run.go @@ -113,6 +113,7 @@ func doit(sess *session.Session, targets []*ssm.Target, bucket, keyPrefix, comma commandId := resp.Command.CommandId printedInstanceIds := []string{} + printedInstanceList := false for { time.Sleep(time.Second * 3) @@ -125,6 +126,15 @@ func doit(sess *session.Session, targets []*ssm.Target, bucket, keyPrefix, comma log.Panicf(err.Error()) } + if !printedInstanceList { + instanceIds := []string{} + for _, invocation := range resp3.CommandInvocations { + instanceIds = append(instanceIds, *invocation.InstanceId) + } + color.Blue("Running command on instances: %+v\n", instanceIds) + printedInstanceList = true + } + for _, invocation := range resp3.CommandInvocations { instanceId := *invocation.InstanceId if stringInSlice(instanceId, printedInstanceIds) {