Skip to content

feat: Add key pair #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ other optional variables (e.g., `name`, `tags`, etc.) provided by the
| `github_organization` | Name of the GitHub organization. | `string` | n/a | yes |
| `github_app_webhook_password` | Password for the GitHub app webhook. An empty string implies a randomly generated password. | `string` | `""` | no |
| `github_organization_runner_enabled` | Toggle to activate runners for all projects in the organization. | `bool` | `true` | no |
| `key_pair_name` | Name of the key pair to associate with the runner | `string` | n/a | no |
| `runner_ephemeral_mode_enabled` | Toggle to activate ephemeral runners. | `bool` | `false` | no |
| `runner_version` | Version of the GitHub Action runner. | `string` | n/a | yes |
| `runner_os` | Operating system for the GitHub Action runner. | `string` | `"linux"` | no |
Expand Down
6 changes: 6 additions & 0 deletions assets/instance/userdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,16 @@ export -f provision_instance_stores

# --- install: core -----------------------------



yum upgrade -y

dnf install -y docker

dnf upgrade --refresh rpm glibc
rm /var/lib/rpm/.rpm.lock
dnf -y update

Comment on lines 61 to +72
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this related to adding a key pair? Maybe it should be removed? If it is required, I provided a suggestion to remove the extra white spaces.

Suggested change
# --- install: core -----------------------------
yum upgrade -y
dnf install -y docker
dnf upgrade --refresh rpm glibc
rm /var/lib/rpm/.rpm.lock
dnf -y update
# --- install: core -----------------------------
yum upgrade -y
dnf install -y docker
dnf upgrade --refresh rpm glibc
rm /var/lib/rpm/.rpm.lock
dnf -y update

yum install --allowerasing -y \
amazon-cloudwatch-agent \
curl \
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "random_string" "github_runner_random_suffix" {

module "github_runner" {
source = "philips-labs/github-runner/aws"
version = "v3.6.1"
version = "v4.2.3"

prefix = module.github_runner_label.id
enable_ephemeral_runners = var.runner_ephemeral_mode_enabled
Expand All @@ -60,6 +60,7 @@ module "github_runner" {
instance_target_capacity_type = lower(var.instance_lifecycle_type)
instance_types = var.instance_types
instance_allocation_strategy = "capacity-optimized"
key_name = var.key_pair_name
logging_retention_in_days = var.log_retention
subnet_ids = var.vpc_subnet_ids
vpc_id = var.vpc_id
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ variable "github_organization_runner_enabled" {
default = true
}

variable "key_pair_name" {
description = "Name of the key pair to associate with the runner"
type = string
default = null
}

variable "runner_ephemeral_mode_enabled" {
type = bool
description = "Toggle to activate ephemeral runners."
Expand Down