I'm running Terraform from my local machine, going through a bastion machine, to create an Amazon Linux EC2.
The problem occurs when I include provisioner entries in my "aws_instance" resource. Without provisioner, the creation completes successfully.
With a provisioner "file" section I get the error:
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
With a provisioner "remote-exec" section I get the following that just keeps repeating until timing out:
module.create_ami.aws_instance.ec2 (remote-exec): Connecting to remote host via SSH...
module.create_ami.aws_instance.ec2 (remote-exec): Host: 99.999.999.99
module.create_ami.aws_instance.ec2 (remote-exec): User: ec2-user
module.create_ami.aws_instance.ec2 (remote-exec): Password: false
module.create_ami.aws_instance.ec2 (remote-exec): Private key: false
module.create_ami.aws_instance.ec2 (remote-exec): SSH Agent: false
module.create_ami.aws_instance.ec2 (remote-exec): Using configured bastion host...
Does anyone know why this would be happening or suggest things to investigate?
module.create_ami.aws_instance.ec2 (remote-exec): Host: 99.999.999.99
doesn't look like a valid IP – Oin