From e86b8cc2bcbc4988ab304faa20444d1953d34e25 Mon Sep 17 00:00:00 2001 From: ehearneredhat Date: Wed, 26 Jun 2024 14:52:43 +0100 Subject: [PATCH] final touches :) --- .../create-self-hosted-runner-ami.yaml | 4 +-- .../workflows/verify-dashboards-alerts.yaml | 25 +++++++++++-------- self-hosted-runner.tf | 8 +++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/create-self-hosted-runner-ami.yaml b/.github/workflows/create-self-hosted-runner-ami.yaml index 627430a6f..bd7bbc1db 100644 --- a/.github/workflows/create-self-hosted-runner-ami.yaml +++ b/.github/workflows/create-self-hosted-runner-ami.yaml @@ -2,8 +2,8 @@ name: Create Self Hosted Runner AMI on: push: - #paths: - #- self-hosted-runner.tf + paths: + - self-hosted-runner.tf jobs: create-self-hosted-runner-ami: diff --git a/.github/workflows/verify-dashboards-alerts.yaml b/.github/workflows/verify-dashboards-alerts.yaml index eca678440..c3d3d02ff 100644 --- a/.github/workflows/verify-dashboards-alerts.yaml +++ b/.github/workflows/verify-dashboards-alerts.yaml @@ -2,15 +2,15 @@ name: Verify Dashboards and Alerts OK on: push: - # paths: - # # Dashboards - # - examples/dashboards/app_developer.json - # - examples/dashboards/business_user.json - # - examples/dashboards/platform_engineer.json - # # Alerts - # - examples/alerts/prometheusrules_policies_missing.yaml - # - examples/alerts/slo-availability.yaml - # - examples/alerts/slo-latency.yaml + paths: + # Dashboards + - examples/dashboards/app_developer.json + - examples/dashboards/business_user.json + - examples/dashboards/platform_engineer.json + # Alerts + - examples/alerts/prometheusrules_policies_missing.yaml + - examples/alerts/slo-availability.yaml + - examples/alerts/slo-latency.yaml jobs: deploy-register-self-runner: runs-on: ubuntu-latest @@ -20,7 +20,10 @@ jobs: - uses: hashicorp/setup-terraform@v3 - name: Initialize Terraform Environment - run: terraform init + run: | + # Remove ami-self-hosted-runner.tf to prevent constant creation of AMIs + rm ami-self-hosted-runner.tf + terraform init - name: Create PEM files run: | @@ -260,6 +263,8 @@ jobs: - name: Initialize Terraform Environment run: | + # Remove ami-self-hosted-runner.tf to prevent constant creation of AMIs + rm ami-self-hosted-runner.tf terraform init - name: Download statefile to teardown resources diff --git a/self-hosted-runner.tf b/self-hosted-runner.tf index bfa9beb20..fe603e407 100644 --- a/self-hosted-runner.tf +++ b/self-hosted-runner.tf @@ -20,7 +20,7 @@ variable "aws_key_name" { } resource "aws_instance" "self_hosted_runner" { - ami = "ami-0776c814353b4814d" # change to ami-0776c814353b4814d when creating an AMI. + ami = "ami-055032149717ffb30" # change to ami-0776c814353b4814d when creating an AMI. instance_type = "t2.xlarge" root_block_device { @@ -36,7 +36,9 @@ resource "aws_instance" "self_hosted_runner" { // Security Group for SSH, HTTP, and HTTPS access security_groups = ["ssh-http-https-access"] - user_data = <<-EOL + # Uncomment when creating an AMI . + + /* user_data = <<-EOL #!/bin/bash echo "Starting user_data script..." sudo apt-get update -y @@ -60,7 +62,7 @@ resource "aws_instance" "self_hosted_runner" { sudo chmod 7777 kuadrant-operator/hack echo "user_data script execution completed." touch /tmp/user_data_done - EOL + EOL */ }