Skip to content

Commit 9ae6cfc

Browse files
fixed wait for spot instance (#119)
* fixed wait for instance * fixed wait for instance --------- Co-authored-by: filipecosta90 <filipecosta.90@gmail.com>
1 parent 3a2f447 commit 9ae6cfc

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

terraform/oss-redisearch-m5-spot-instances/bench-client-resources.tf

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ resource "aws_spot_instance_request" "client" {
2222
################################################################################
2323
# This will ensure we wait here until the instance is ready to receive the ssh connection
2424
################################################################################
25-
provisioner "remote-exec" {
26-
script = "./../scripts/wait_for_instance.sh"
27-
connection {
28-
host = self.public_ip # The `self` variable is like `this` in many programming languages
29-
type = "ssh" # in this case, `self` is the resource (the server).
30-
user = var.ssh_user
31-
private_key = file(var.private_key)
32-
#need to increase timeout to larger then 5m for metal instances
33-
timeout = "15m"
34-
agent = "false"
35-
}
36-
}
25+
user_data = <<-EOF
26+
#!/bin/bash
27+
echo "Instance is ready" > /var/log/instance_ready.log
28+
EOF
3729

3830
################################################################################
3931
# Deployment related

terraform/oss-redisearch-m5-spot-instances/db-resources.tf

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,10 @@ resource "aws_spot_instance_request" "server" {
3636
################################################################################
3737
# This will ensure we wait here until the instance is ready to receive the ssh connection
3838
################################################################################
39-
provisioner "remote-exec" {
40-
script = "./../scripts/wait_for_instance.sh"
41-
connection {
42-
host = self.public_ip # The `self` variable is like `this` in many programming languages
43-
type = "ssh" # in this case, `self` is the resource (the server).
44-
user = var.ssh_user
45-
private_key = file(var.private_key)
46-
#need to increase timeout to larger then 5m for metal instances
47-
timeout = "15m"
48-
agent = "false"
49-
}
50-
}
39+
user_data = <<-EOF
40+
#!/bin/bash
41+
echo "Instance is ready" > /var/log/instance_ready.log
42+
EOF
5143

5244
################################################################################
5345
# Deployment related

0 commit comments

Comments
 (0)