Skip to content

Commit 3a2f447

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

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

terraform/oss-standalone-redisearch-m5/bench-client-resources.tf

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,10 @@ resource "aws_instance" "client" {
4646
################################################################################
4747
# This will ensure we wait here until the instance is ready to receive the ssh connection
4848
################################################################################
49-
provisioner "remote-exec" {
50-
script = "./../scripts/wait_for_instance.sh"
51-
connection {
52-
host = self.public_ip # The `self` variable is like `this` in many programming languages
53-
type = "ssh" # in this case, `self` is the resource (the server).
54-
user = var.ssh_user
55-
private_key = file(var.private_key)
56-
#need to increase timeout to larger then 5m for metal instances
57-
timeout = "5m"
58-
agent = "false"
59-
}
60-
}
49+
user_data = <<-EOF
50+
#!/bin/bash
51+
echo "Instance is ready" > /var/log/instance_ready.log
52+
EOF
6153

6254
################################################################################
6355
# Deployment related

terraform/oss-standalone-redisearch-m5/db-resources.tf

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,10 @@ resource "aws_instance" "server" {
5151
################################################################################
5252
# This will ensure we wait here until the instance is ready to receive the ssh connection
5353
################################################################################
54-
provisioner "remote-exec" {
55-
script = "./../scripts/wait_for_instance.sh"
56-
connection {
57-
host = self.public_ip # The `self` variable is like `this` in many programming languages
58-
type = "ssh" # in this case, `self` is the resource (the server).
59-
user = var.ssh_user
60-
private_key = file(var.private_key)
61-
#need to increase timeout to larger then 5m for metal instances
62-
timeout = "15m"
63-
agent = "false"
64-
}
65-
}
54+
user_data = <<-EOF
55+
#!/bin/bash
56+
echo "Instance is ready" > /var/log/instance_ready.log
57+
EOF
6658

6759
################################################################################
6860
# Deployment related

0 commit comments

Comments
 (0)