Skip to content
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

GHA runners - filter AMI by name over ID, simplifying multi-region maintenance #951

Merged
merged 2 commits into from
Oct 25, 2022
Merged
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
3 changes: 2 additions & 1 deletion terraform-aws-github-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ module "runners" {
block_device_mappings = var.block_device_mappings

runner_architecture = local.runner_architecture
ami_owners = var.ami_owners
ami_owners_linux = var.ami_owners_linux
ami_owners_windows = var.ami_owners_windows
ami_filter_linux = var.ami_filter_linux
ami_filter_windows = var.ami_filter_windows

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "files" {
value = null_resource.download.*.triggers.file
value = null_resource.download[*].triggers.file
}
4 changes: 2 additions & 2 deletions terraform-aws-github-runner/modules/runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data "aws_ami" "runner_ami_linux" {
}
}

owners = var.ami_owners
owners = var.ami_owners_linux
}

data "aws_ami" "runner_ami_windows" {
Expand All @@ -53,7 +53,7 @@ data "aws_ami" "runner_ami_windows" {
}
}

owners = var.ami_owners
owners = var.ami_owners_windows
}

resource "aws_launch_template" "linux_runner" {
Expand Down
10 changes: 8 additions & 2 deletions terraform-aws-github-runner/modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ variable "ami_filter_windows" {
}
}

variable "ami_owners" {
description = "The list of owners used to select the AMI of action runner instances."
variable "ami_owners_linux" {
description = "The list of owners used to select the AMI of linux action runner instances."
type = list(string)
default = ["amazon"]
}

variable "ami_owners_windows" {
description = "The list of owners used to select the AMI of windows action runner instances."
type = list(string)
default = ["amazon"]
}
Expand Down
10 changes: 8 additions & 2 deletions terraform-aws-github-runner/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,14 @@ variable "ami_filter_windows" {
}
}

variable "ami_owners" {
description = "The list of owners used to select the AMI of action runner instances."
variable "ami_owners_linux" {
description = "The list of owners used to select the AMI of linux action runner instances."
type = list(string)
default = ["amazon"]
}

variable "ami_owners_windows" {
description = "The list of owners used to select the AMI of windows action runner instances."
type = list(string)
default = ["amazon"]
}
Expand Down