Skip to content

Multi-runner v2 example

This example demonstrates the experimental multi-runner v2 interface. Shared defaults are configured with global_config* variables, while each runner lane uses multi_runner_config for its matcher, runner lifecycle, and compute-provider settings.

The example creates three lanes from one deployment:

  • Linux ARM64 Amazon Linux runners.
  • Ephemeral Linux x64 Amazon Linux runners with job retry enabled.
  • Windows x64 Server Core 2022 runners.

The v2 interface keeps provider-owned settings inside the selected provider configuration. For example, VPC and subnet settings are under global_config_compute_provider.aws.ec2, while the per-lane instance types and AMI configuration are under each lane's compute provider block. The optional ami variable can provide per-lane AMI filters and owners, which is useful for test environments with locally registered images.

Configure the GitHub App variables before applying:

terraform init
terraform apply \
  -var='github_app={id="123456",key_base64="..."}'

The github_app value is sensitive and should be supplied through a secure variable source in real deployments rather than committed to configuration.

Requirements

Name Version
terraform >= 1.4.0
aws >= 6.33
local ~> 2.0
random ~> 3.0

Providers

Name Version
random 3.9.0

Modules

Name Source Version
base ../base n/a
runners ../../modules/multi-runner n/a
webhook_github_app ../../modules/webhook-github-app n/a

Resources

Name Type
random_id.random resource

Inputs

Name Description Type Default Required
ami Optional AMI configuration keyed by runner lane.
map(object({
filter = optional(map(list(string)), { state = ["available"] })
owners = optional(list(string), ["amazon"])
id_ssm_parameter = optional(object({
arn = string
}), null)
kms_key = optional(object({
arn = string
}), null)
}))
{} no
aws_region AWS region to deploy to. string "eu-west-1" no
environment Environment name, used as prefix. string null no
github_app GitHub App ID and base64-encoded private key.
object({
id = string
key_base64 = string
})
n/a yes

Outputs

Name Description
webhook_endpoint n/a
webhook_secret n/a