Skip to content
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
2 changes: 2 additions & 0 deletions terraform-aws-github-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ module "runners_instances" {
block_device_mappings = var.block_device_mappings

runner_architecture = local.runner_architecture
ami_id_pining_linux = var.ami_id_pining_linux
ami_id_pining_linux_arm64 = var.ami_id_pining_linux_arm64
ami_owners_linux = var.ami_owners_linux
ami_owners_linux_arm64 = var.ami_owners_linux_arm64
ami_owners_windows = var.ami_owners_windows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ locals {
}

data "aws_ami" "runner_ami_linux" {
count = var.ami_id_pining_linux == null ? 1 : 0
most_recent = "true"

dynamic "filter" {
Expand All @@ -45,6 +46,7 @@ data "aws_ami" "runner_ami_linux" {
}

data "aws_ami" "runner_ami_linux_arm64" {
count = var.ami_id_pining_linux_arm64 == null ? 1 : 0
most_recent = "true"

dynamic "filter" {
Expand Down Expand Up @@ -81,7 +83,7 @@ resource "aws_launch_template" "linux_runner" {

instance_initiated_shutdown_behavior = "terminate"

image_id = data.aws_ami.runner_ami_linux.id
image_id = var.ami_id_pining_linux == null ? data.aws_ami.runner_ami_linux[0].id : var.ami_id_pining_linux
instance_type = var.instance_type
key_name = var.key_name

Expand Down Expand Up @@ -138,7 +140,7 @@ resource "aws_launch_template" "linux_runner_nvidia" {

instance_initiated_shutdown_behavior = "terminate"

image_id = data.aws_ami.runner_ami_linux.id
image_id = var.ami_id_pining_linux == null ? data.aws_ami.runner_ami_linux[0].id : var.ami_id_pining_linux
instance_type = var.instance_type
key_name = var.key_name

Expand Down Expand Up @@ -195,7 +197,7 @@ resource "aws_launch_template" "linux_arm64_runner" {

instance_initiated_shutdown_behavior = "terminate"

image_id = data.aws_ami.runner_ami_linux_arm64.id
image_id = var.ami_id_pining_linux_arm64 == null ? data.aws_ami.runner_ami_linux_arm64[0].id : var.ami_id_pining_linux_arm64
instance_type = var.instance_type
key_name = var.key_name

Expand Down
12 changes: 12 additions & 0 deletions terraform-aws-github-runner/modules/runners-instances/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ variable "instance_type" {
default = "m5.large"
}

variable "ami_id_pining_linux" {
description = "The AMI ID to pin the linux action runner instances to."
type = string
default = null
}

variable "ami_id_pining_linux_arm64" {
description = "The AMI ID to pin the linux action runner instances to."
type = string
default = null
}

variable "ami_filter_linux" {
description = "List of maps used to create the AMI filter for the action runner AMI."
type = map(list(string))
Expand Down
12 changes: 12 additions & 0 deletions terraform-aws-github-runner/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,18 @@ variable "block_device_mappings" {
default = {}
}

variable "ami_id_pining_linux" {
description = "The AMI ID to pin the linux action runner instances to."
type = string
default = null
}

variable "ami_id_pining_linux_arm64" {
description = "The AMI ID to pin the linux action runner instances to."
type = string
default = null
}

variable "ami_filter_linux" {
description = "List of maps used to create the AMI filter for the action runner AMI."
type = map(list(string))
Expand Down
Loading