-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/aws: unable to bootstrap a spot instance (connection data is not set) #3762
Comments
I don't see a value for the host attribute in the connection logging, so maybe add a reference to the associated public IP in the connection block (probably by using an interpolated value)? |
No luck. The resulting attribute should exist as aws_spot_instance_request bases itself on the aws_instance schema.
According to the docs this should be provided automatically. (https://terraform.io/docs/provisioners/connection.html)
|
@jwmarshall I just had a look at the code and noticed that the connection data is not set in the spot resource. So I guess (based on the docs) this should be labeled as a bug and needs to be fixed... |
Makes sense. Thanks for your help! If I have some time this weekend and the local development setup isnt too difficult I can look at bringing the relevant lines out of aws_instance. |
+1 I just ran in to this as well. |
Yea haven't had anytime to try and tackle this one myself. Maybe I can find a few hours on the weekend. |
I have a patch for this, once I get a test confirming I'll open a PR |
👍 |
Fix is in #3940 , if you can, take it for a spin, otherwise it is under review. I was able to get this to work: resource "aws_spot_instance_request" "cheap_worker" {
ami = "ami-6f6d635f"
spot_price = "0.04"
instance_type = "t1.micro"
wait_for_fulfillment = true
subnet_id = "${aws_subnet.tf_test_subnet.id}"
vpc_security_group_ids = ["${aws_security_group.tf_test_sg_ssh.id}"]
key_name = "${aws_key_pair.ssh_thing.key_name}"
associate_public_ip_address = true
provisioner "remote-exec" {
connection {
user = "ubuntu"
key_file = "/Users/clint/.ssh/id_rsa2"
agent = "false"
}
inline = [
"echo 'hello world'",
]
}
} Where the subnet and Sg are configured to all SSH |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Maybe I'm missing something silly here, but I cannot seem to bootstrap a spot instance with terraform.
My terraform file:
The spot instance is requested, fulfilled, but never bootstrapped. Once the instance exists terraform simply displays the following lines over and over until it a timeout is reached.
The text was updated successfully, but these errors were encountered: