Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
  • Loading branch information
ehearneRedHat committed Jun 26, 2024
1 parent 1e7888e commit a32ed8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions self-hosted-runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ variable "aws_key_name" {
type = string
}

resource "aws_instance" "example" {
ami = "ami-0776c814353b4814d"
resource "aws_instance" "self_hosted_runner" {
ami = "self-hosted-runner-ami"
instance_type = "t2.xlarge"

root_block_device {
Expand Down Expand Up @@ -105,17 +105,17 @@ resource "aws_security_group" "ssh_http_https_access" {
resource "null_resource" "wait_for_user_data" {
provisioner "local-exec" {
command = <<EOT
while ! ssh -o StrictHostKeyChecking=no -i ${aws_instance.example.key_name}.pem ubuntu@${aws_instance.example.public_ip} 'test -f /tmp/user_data_done'; do
while ! ssh -o StrictHostKeyChecking=no -i ${aws_instance.self_hosted_runner.key_name}.pem ubuntu@${aws_instance.self_hosted_runner.public_ip} 'test -f /tmp/user_data_done'; do
echo "Waiting for user_data script to complete..."
sleep 10
done
echo "user_data script completed."
EOT
}

depends_on = [aws_instance.example]
depends_on = [aws_instance.self_hosted_runner]
}

output "instance_public_ip" {
value = aws_instance.example.public_ip
value = aws_instance.self_hosted_runner.public_ip
}

0 comments on commit a32ed8a

Please sign in to comment.