Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 39c019c

Browse files
authored
fix(examples): Update AMI filter (#1673)
- Updated AMI filter to select the latest instead of the latest in 2012 - Add commented examples for AMI and ephemeral to ubuntu example
1 parent 997b171 commit 39c019c

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Diff for: examples/ephemeral/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module "runners" {
6666

6767
# configure your pre-built AMI
6868
# enabled_userdata = false
69-
# ami_filter = { name = ["github-runner-amzn2-x86_64-2021*"] }
69+
# ami_filter = { name = ["github-runner-amzn2-x86_64-*"] }
7070
# ami_owners = [data.aws_caller_identity.current.account_id]
7171

7272
# Enable logging

Diff for: examples/prebuilt/variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ variable "runner_os" {
1010

1111
variable "ami_name_filter" {
1212
type = string
13-
default = "github-runner-amzn2-x86_64-2021*"
13+
default = "github-runner-amzn2-x86_64-*"
1414
}
1515

1616
variable "aws_region" {
1717
type = string
1818
default = "eu-west-1"
19-
}
19+
}

Diff for: examples/ubuntu/main.tf

+19-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ resource "random_id" "random" {
77
byte_length = 20
88
}
99

10+
data "aws_caller_identity" "current" {}
11+
1012
module "runners" {
1113
source = "../../"
1214

@@ -35,14 +37,25 @@ module "runners" {
3537
# enable access to the runners via SSM
3638
enable_ssm_on_runners = true
3739

38-
runner_run_as = "ubuntu"
40+
runner_run_as = "ubuntu"
41+
42+
# AMI selection and userdata
43+
#
44+
# option 1. configure your pre-built AMI + userdata
3945
userdata_template = "./templates/user-data.sh"
4046
ami_owners = ["099720109477"] # Canonical's Amazon account ID
4147

4248
ami_filter = {
4349
name = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
4450
}
4551

52+
# Custom build AMI, no custom userdata needed.
53+
# option 2: Build custom AMI see ../../images/ubuntu-focal
54+
# disable lines above (option 1) and enable the ones below
55+
# ami_filter = { name = ["github-runner-ubuntu-focal-amd64-*"] }
56+
# ami_owners = [data.aws_caller_identity.current.account_id]
57+
58+
4659
block_device_mappings = {
4760
# Set the block device name for Ubuntu root device
4861
device_name = "/dev/sda1"
@@ -69,6 +82,11 @@ module "runners" {
6982
}
7083
]
7184

85+
# Uncomment to enable ephemeral runners
86+
# delay_webhook_event = 0
87+
# enable_ephemeral_runners = true
88+
# enabled_userdata = false
89+
7290
# Uncommet idle config to have idle runners from 9 to 5 in time zone Amsterdam
7391
# idle_config = [{
7492
# cron = "* * 9-17 * * *"

0 commit comments

Comments
 (0)