Skip to content

Commit

Permalink
better implementation of tf script for use with github actions and se…
Browse files Browse the repository at this point in the history
…crets
  • Loading branch information
ehearneRedHat committed Jun 20, 2024
1 parent 8aa1acb commit 4a08f4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions self-hosted-runner.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
provider "aws" {
region = "eu-west-1"
access_key = var.aws_access_key
secret_key = var.aws_secret_key
}

resource "aws_instance" "example" {
Expand All @@ -10,7 +12,7 @@ resource "aws_instance" "example" {
volume_size = 16 // GB
}

key_name = "** INSERT KEY FILE NAME HERE **"
key_name = var.aws_key_name

tags = {
Name = "kuadrant-operator-self-hosted-runner"
Expand Down Expand Up @@ -85,7 +87,7 @@ 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 < insert pem file here > ubuntu@${aws_instance.example.public_ip} 'test -f /tmp/user_data_done'; do
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
echo "Waiting for user_data script to complete..."
sleep 10
done
Expand Down

0 comments on commit 4a08f4a

Please sign in to comment.