Skip to content

Commit f524390

Browse files
authored
GHA runners - Separate AMI owner filters for linux and windows instances (#951)
1 parent e6c764f commit f524390

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

terraform-aws-github-runner/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ module "runners" {
8383
block_device_mappings = var.block_device_mappings
8484

8585
runner_architecture = local.runner_architecture
86-
ami_owners = var.ami_owners
86+
ami_owners_linux = var.ami_owners_linux
87+
ami_owners_windows = var.ami_owners_windows
8788
ami_filter_linux = var.ami_filter_linux
8889
ami_filter_windows = var.ami_filter_windows
8990

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
output "files" {
2-
value = null_resource.download.*.triggers.file
2+
value = null_resource.download[*].triggers.file
33
}

terraform-aws-github-runner/modules/runners/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ data "aws_ami" "runner_ami_linux" {
3939
}
4040
}
4141

42-
owners = var.ami_owners
42+
owners = var.ami_owners_linux
4343
}
4444

4545
data "aws_ami" "runner_ami_windows" {
@@ -53,7 +53,7 @@ data "aws_ami" "runner_ami_windows" {
5353
}
5454
}
5555

56-
owners = var.ami_owners
56+
owners = var.ami_owners_windows
5757
}
5858

5959
resource "aws_launch_template" "linux_runner" {

terraform-aws-github-runner/modules/runners/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,14 @@ variable "ami_filter_windows" {
9292
}
9393
}
9494

95-
variable "ami_owners" {
96-
description = "The list of owners used to select the AMI of action runner instances."
95+
variable "ami_owners_linux" {
96+
description = "The list of owners used to select the AMI of linux action runner instances."
97+
type = list(string)
98+
default = ["amazon"]
99+
}
100+
101+
variable "ami_owners_windows" {
102+
description = "The list of owners used to select the AMI of windows action runner instances."
97103
type = list(string)
98104
default = ["amazon"]
99105
}

terraform-aws-github-runner/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,14 @@ variable "ami_filter_windows" {
217217
}
218218
}
219219

220-
variable "ami_owners" {
221-
description = "The list of owners used to select the AMI of action runner instances."
220+
variable "ami_owners_linux" {
221+
description = "The list of owners used to select the AMI of linux action runner instances."
222+
type = list(string)
223+
default = ["amazon"]
224+
}
225+
226+
variable "ami_owners_windows" {
227+
description = "The list of owners used to select the AMI of windows action runner instances."
222228
type = list(string)
223229
default = ["amazon"]
224230
}

0 commit comments

Comments
 (0)