retry runinstances aws api that wasn't retried and could fail

This commit is contained in:
cove 2019-11-06 14:06:35 -08:00 committed by Cove
parent fdd12c4e9f
commit 2898d66812
No known key found for this signature in database
GPG Key ID: 40D9E24AAB46CD1D
1 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,9 @@ func (s *StepRunSourceInstance) Run(ctx context.Context, state multistep.StateBa
runOpts.InstanceInitiatedShutdownBehavior = &s.InstanceInitiatedShutdownBehavior
}
runResp, err := ec2conn.RunInstances(runOpts)
runReq, runResp := ec2conn.RunInstancesRequest(runOpts)
runReq.RetryCount = 11
err = runReq.Send()
if err != nil {
err := fmt.Errorf("Error launching source instance: %s", err)
state.Put("error", err)