Having the same issue:
Terraform v1.0.7
aws provider v3.61.0
Error: remote-exec provisioner error
with module.sio.aws_instance.sio[0],
on …/…/modules/sio/main.tf line 25, in resource “aws_instance” “sio”:
25: provisioner “remote-exec” {
error executing “/tmp/terraform_759382728.sh”: Process exited with status 1
2021-10-05T07:11:02.830-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err=“rpc error: code = Unavailable desc = transport is closing”
2021-10-05T07:11:02.831-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/template/2.2.0/linux_amd64/terraform-provider-template_v2.2.0_x4 pid=10778
2021-10-05T07:11:02.831-0500 [DEBUG] provider: plugin exited
2021-10-05T07:11:02.834-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/3.61.0/linux_amd64/terraform-provider-aws_v3.61.0_x5 pid=10791
2021-10-05T07:11:02.834-0500 [DEBUG] provider: plugin exited