Loading...
Loading...
As per the question on Terraform's google group: https://groups.google.com/forum/#!topic/terraform-tool/4Pmq5W8AXDo, I am unable to provision an AWS instance via a bastion host unless I use the same key for both instances. I was unable to locate a similar issue. If one exists, feel free to reference it. ### Terraform Version Terraform v0.6.10 ### Affected Resource(s) Please list the resources as a list, for example: - aws_instance - provisioner connection - provisioner "file" ### Terraform Configuration Files ``` hcl resource "aws_instance" "locust" { instance_type = "${var.instance_type}" ami = "${var.ami_id}" subnet_id = "${element(split(",", terraform_remote_state.eng.output.private_subnet_ids), 2)}" vpc_security_group_ids = ["${aws_security_group.locust.id}"] key_name = "${var.key}" iam_instance_profile = "${aws_iam_instance_profile.locust.id}" connection { user = "ec2-user" key_file = "${var.key}.pem" bastion_host = "${terraform_remote_state.eng.output.nat_eip_public_ips}" bastion_key = "${var.bastion_key}.pem" agent = false } provisioner "file" { source = "config/locust_config.json" destination = "/tmp/config.json" } provisioner "file" { source = "scripts/${var.locust_script}" destination = "/tmp/install.sh" } provisioner "remote-exec" { inline = [ "chmod +x /tmp/install.sh", "/tmp/install.sh ${var.environment} ${var.consul_ip}" ] } ``` ### Expected Behavior Host should have been provisioned. This occurs if both the bastion host and and aws_instance.locust use the same key. ### Actual Behavior ``` aws_instance.locust: Provisioning with 'file'... Error applying plan: 1 error(s) occurred: * Error connecting to bastion: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain ``` ### Steps to Reproduce Please list the steps required to reproduce the issue, for example: 1. terraform apply -var-file=var-files/environment_vars ### Important Factoids None I know of. ### References https://groups.google.com/forum/#!topic/terraform-tool/4Pmq5W8AXDo
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.