Packer AWS ebs builder scp timeout Upload failed: wait: remote command exited without exit status or exit signal

We are seeing intermittent scp timeouts during scp images to aws .
we are using SSH communicator to scp base images to aws.
is there way we can add retry logic to scp ? We use SSH proxy for going out our corporate network.

SCP works most of time, but fails intermittently .

Thanks
Venkat

“communicator”: “ssh”,
“provisioners”: [
{
“type”: “file”,
“source”: “{{user ova_path }}”,
“destination”: “/home/ubuntu/se.ova”
},

2020-04-13 00:12:02.203 | e[1;32m==> amazon-ebssurrogate: Using ssh communicator to connect: 54.176.86.221e[0m
2020-04-13 00:12:02.204 | e[1;32m==> amazon-ebssurrogate: Waiting for SSH to become available…e[0m
2020-04-13 00:12:34.363 | e[1;32m==> amazon-ebssurrogate: Connected to SSH!e[0m
2020-04-13 00:12:34.364 | e[1;32m==> amazon-ebssurrogate: Uploading …/ova/case-1.1.2.112.ova => /home/ubuntu/se.ovae[0m
2020-04-13 00:12:34.364 |
case-1.1.2.112.ova 3.94 MiB / 5.51 GiB 0.07% 04m43s
2020-04-13 00:12:34.364 | e[1A
case-1.1.2.112.ova 10.44 MiB / 5.51 GiB 0.18% 03m32s


2020-04-13 00:12:54.463 | e[1;31m==> amazon-ebssurrogate: Upload failed: wait: remote command exited without exit status or exit signale[0m
2020-04-13 00:12:54.463 | e[1A
case-1.1.2.112.ova 590.38 MiB / 5.51 GiB 10.46% 22s
2020-04-13 00:12:54.463 | e[1;32m==> amazon-ebssurrogate: Provisioning step had errors: Running the cleanup provisioner, if present…e[0m
2020-04-13 00:12:54.464 | e[1;32m==> amazon-ebssurrogate: Terminating the source AWS instance…e[0m