|
| 1 | +locals { |
| 2 | + environment = "ubuntu" |
| 3 | + aws_region = "eu-west-1" |
| 4 | +} |
| 5 | + |
| 6 | +resource "random_password" "random" { |
| 7 | + length = 28 |
| 8 | +} |
| 9 | + |
| 10 | +module "runners" { |
| 11 | + source = "../../" |
| 12 | + |
| 13 | + aws_region = local.aws_region |
| 14 | + vpc_id = module.vpc.vpc_id |
| 15 | + subnet_ids = module.vpc.private_subnets |
| 16 | + |
| 17 | + environment = local.environment |
| 18 | + tags = { |
| 19 | + Project = "ProjectX" |
| 20 | + } |
| 21 | + |
| 22 | + github_app = { |
| 23 | + key_base64 = var.github_app_key_base64 |
| 24 | + id = var.github_app_id |
| 25 | + client_id = var.github_app_client_id |
| 26 | + client_secret = var.github_app_client_secret |
| 27 | + webhook_secret = random_password.random.result |
| 28 | + } |
| 29 | + |
| 30 | + webhook_lambda_zip = "lambdas-download/webhook.zip" |
| 31 | + runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip" |
| 32 | + runners_lambda_zip = "lambdas-download/runners.zip" |
| 33 | + |
| 34 | + enable_organization_runners = false |
| 35 | + runner_extra_labels = "ubuntu,example" |
| 36 | + |
| 37 | + # enable access to the runners via SSM |
| 38 | + enable_ssm_on_runners = true |
| 39 | + |
| 40 | + userdata_template = "./templates/user-data.sh" |
| 41 | + ami_owners = ["099720109477"] # Canonical's Amazon account ID |
| 42 | + |
| 43 | + ami_filter = { |
| 44 | + name = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] |
| 45 | + } |
| 46 | + |
| 47 | + block_device_mappings = { |
| 48 | + # Set the block device name for Ubuntu root device |
| 49 | + device_name = "/dev/sda1" |
| 50 | + } |
| 51 | + |
| 52 | + # Uncommet idle config to have idle runners from 9 to 5 in time zone Amsterdam |
| 53 | + # idle_config = [{ |
| 54 | + # cron = "* * 9-17 * * *" |
| 55 | + # timeZone = "Europe/Amsterdam" |
| 56 | + # idleCount = 1 |
| 57 | + # }] |
| 58 | + |
| 59 | + # disable KMS and encryption |
| 60 | + # encrypt_secrets = false |
| 61 | +} |
0 commit comments