|
| 1 | +locals { |
| 2 | + environment = "ephemeraal" |
| 3 | + aws_region = "eu-west-1" |
| 4 | +} |
| 5 | + |
| 6 | +resource "random_id" "random" { |
| 7 | + byte_length = 20 |
| 8 | +} |
| 9 | + |
| 10 | +data "aws_caller_identity" "current" {} |
| 11 | + |
| 12 | +module "runners" { |
| 13 | + source = "../../" |
| 14 | + create_service_linked_role_spot = true |
| 15 | + aws_region = local.aws_region |
| 16 | + vpc_id = module.vpc.vpc_id |
| 17 | + subnet_ids = module.vpc.private_subnets |
| 18 | + |
| 19 | + environment = local.environment |
| 20 | + tags = { |
| 21 | + Project = "ProjectX" |
| 22 | + } |
| 23 | + |
| 24 | + github_app = { |
| 25 | + key_base64 = var.github_app_key_base64 |
| 26 | + id = var.github_app_id |
| 27 | + webhook_secret = random_id.random.hex |
| 28 | + } |
| 29 | + |
| 30 | + # Grab the lambda packages from local directory. Must run /.ci/build.sh first |
| 31 | + webhook_lambda_zip = "../../lambda_output/webhook.zip" |
| 32 | + runner_binaries_syncer_lambda_zip = "../../lambda_output/runner-binaries-syncer.zip" |
| 33 | + runners_lambda_zip = "../../lambda_output/runners.zip" |
| 34 | + |
| 35 | + enable_organization_runners = true |
| 36 | + runner_extra_labels = "default,example" |
| 37 | + |
| 38 | + # enable access to the runners via SSM |
| 39 | + enable_ssm_on_runners = true |
| 40 | + |
| 41 | + # Let the module manage the service linked role |
| 42 | + # create_service_linked_role_spot = true |
| 43 | + |
| 44 | + instance_types = ["m5.large", "c5.large"] |
| 45 | + |
| 46 | + # override delay of events in seconds |
| 47 | + delay_webhook_event = 0 |
| 48 | + |
| 49 | + # Ensure you set the number not too low, each build require a new instance |
| 50 | + runners_maximum_count = 20 |
| 51 | + |
| 52 | + # override scaling down |
| 53 | + scale_down_schedule_expression = "cron(* * * * ? *)" |
| 54 | + |
| 55 | + enable_ephemeral_runners = true |
| 56 | + |
| 57 | + # configure your pre-built AMI |
| 58 | + # enabled_userdata = false |
| 59 | + # ami_filter = { name = ["github-runner-amzn2-x86_64-2021*"] } |
| 60 | + # ami_owners = [data.aws_caller_identity.current.account_id] |
| 61 | + |
| 62 | + # Enable logging |
| 63 | + # log_level = "debug" |
| 64 | + |
| 65 | + # Setup a dead letter queue, by default scale up lambda will kepp retrying to process event in case of scaling error. |
| 66 | + # redrive_policy_build_queue = { |
| 67 | + # enabled = true |
| 68 | + # maxReceiveCount = 50 # 50 retries every 30 seconds => 25 minutes |
| 69 | + # deadLetterTargetArn = null |
| 70 | + # } |
| 71 | +} |
0 commit comments