From 1d01f97adb1d75569a73f08cd718e68ae20f2d89 Mon Sep 17 00:00:00 2001 From: Jean Schmidt Date: Tue, 25 Oct 2022 11:32:19 +0100 Subject: [PATCH 1/2] GHA runners - filter AMI by name over ID, simplifying multi-region maintenance --- terraform-aws-github-runner/main.tf | 3 ++- terraform-aws-github-runner/modules/runners/main.tf | 4 ++-- .../modules/runners/variables.tf | 10 ++++++++-- terraform-aws-github-runner/variables.tf | 10 ++++++++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/terraform-aws-github-runner/main.tf b/terraform-aws-github-runner/main.tf index 61895e8eb6..9838b0f78d 100644 --- a/terraform-aws-github-runner/main.tf +++ b/terraform-aws-github-runner/main.tf @@ -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 diff --git a/terraform-aws-github-runner/modules/runners/main.tf b/terraform-aws-github-runner/modules/runners/main.tf index 508818ff30..3da6257884 100644 --- a/terraform-aws-github-runner/modules/runners/main.tf +++ b/terraform-aws-github-runner/modules/runners/main.tf @@ -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" { @@ -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" { diff --git a/terraform-aws-github-runner/modules/runners/variables.tf b/terraform-aws-github-runner/modules/runners/variables.tf index 04ab6d7d2a..0ba0dac2bb 100644 --- a/terraform-aws-github-runner/modules/runners/variables.tf +++ b/terraform-aws-github-runner/modules/runners/variables.tf @@ -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"] } diff --git a/terraform-aws-github-runner/variables.tf b/terraform-aws-github-runner/variables.tf index 12fbcedc06..3770be215d 100644 --- a/terraform-aws-github-runner/variables.tf +++ b/terraform-aws-github-runner/variables.tf @@ -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"] } From 6fac03b7ddbc79fd006a295600d120fe25fdb563 Mon Sep 17 00:00:00 2001 From: Jean Schmidt Date: Tue, 25 Oct 2022 11:39:21 +0100 Subject: [PATCH 2/2] download-lambda/outputs.tf - new tflint rule terraform_deprecated_index --- terraform-aws-github-runner/modules/download-lambda/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-aws-github-runner/modules/download-lambda/outputs.tf b/terraform-aws-github-runner/modules/download-lambda/outputs.tf index 41857312fa..87a4238512 100644 --- a/terraform-aws-github-runner/modules/download-lambda/outputs.tf +++ b/terraform-aws-github-runner/modules/download-lambda/outputs.tf @@ -1,3 +1,3 @@ output "files" { - value = null_resource.download.*.triggers.file + value = null_resource.download[*].triggers.file }