main.tf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. locals {
  2. environment = "prebuilt"
  3. }
  4. resource "random_id" "random" {
  5. byte_length = 20
  6. }
  7. data "aws_caller_identity" "current" {}
  8. module "runners" {
  9. source = "../../"
  10. create_service_linked_role_spot = true
  11. aws_region = var.aws_region
  12. vpc_id = module.vpc.vpc_id
  13. subnet_ids = module.vpc.private_subnets
  14. prefix = local.environment
  15. github_app = {
  16. key_base64 = var.github_app_key_base64
  17. id = var.github_app_id
  18. webhook_secret = random_id.random.hex
  19. }
  20. webhook_lambda_zip = "lambdas-download/webhook.zip"
  21. runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
  22. runners_lambda_zip = "lambdas-download/runners.zip"
  23. runner_extra_labels = "default,example"
  24. runner_os = var.runner_os
  25. # configure your pre-built AMI
  26. enabled_userdata = false
  27. ami_filter = { name = [var.ami_name_filter] }
  28. ami_owners = [data.aws_caller_identity.current.account_id]
  29. # enable access to the runners via SSM
  30. enable_ssm_on_runners = true
  31. # override delay of events in seconds
  32. delay_webhook_event = 5
  33. # override scaling down
  34. scale_down_schedule_expression = "cron(* * * * ? *)"
  35. }