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

fix(examples): Update AMI filter #1673

Merged
merged 1 commit into from
Jan 28, 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
2 changes: 1 addition & 1 deletion examples/ephemeral/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module "runners" {

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

# Enable logging
Expand Down
4 changes: 2 additions & 2 deletions examples/prebuilt/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ variable "runner_os" {

variable "ami_name_filter" {
type = string
default = "github-runner-amzn2-x86_64-2021*"
default = "github-runner-amzn2-x86_64-*"
}

variable "aws_region" {
type = string
default = "eu-west-1"
}
}
20 changes: 19 additions & 1 deletion examples/ubuntu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ resource "random_id" "random" {
byte_length = 20
}

data "aws_caller_identity" "current" {}

module "runners" {
source = "../../"

Expand Down Expand Up @@ -35,14 +37,25 @@ module "runners" {
# enable access to the runners via SSM
enable_ssm_on_runners = true

runner_run_as = "ubuntu"
runner_run_as = "ubuntu"

# AMI selection and userdata
#
# option 1. configure your pre-built AMI + userdata
userdata_template = "./templates/user-data.sh"
ami_owners = ["099720109477"] # Canonical's Amazon account ID

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

# Custom build AMI, no custom userdata needed.
# option 2: Build custom AMI see ../../images/ubuntu-focal
# disable lines above (option 1) and enable the ones below
# ami_filter = { name = ["github-runner-ubuntu-focal-amd64-*"] }
# ami_owners = [data.aws_caller_identity.current.account_id]


block_device_mappings = {
# Set the block device name for Ubuntu root device
device_name = "/dev/sda1"
Expand All @@ -69,6 +82,11 @@ module "runners" {
}
]

# Uncomment to enable ephemeral runners
# delay_webhook_event = 0
# enable_ephemeral_runners = true
# enabled_userdata = false

# Uncommet idle config to have idle runners from 9 to 5 in time zone Amsterdam
# idle_config = [{
# cron = "* * 9-17 * * *"
Expand Down