Skip to content

Commit 2a5f023

Browse files
committed
Add extra parameters to configure lambda
1 parent 6f66e1d commit 2a5f023

6 files changed

Lines changed: 59 additions & 5 deletions

File tree

main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module "webhook" {
3232

3333
sqs_build_queue = aws_sqs_queue.queued_builds
3434
github_app_webhook_secret = var.github_app.webhook_secret
35+
36+
lambda_zip = var.webhook_lambda_zip
37+
lambda_timeout = var.webhook_lambda_timeout
3538
}
3639

3740
module "runners" {
@@ -52,6 +55,10 @@ module "runners" {
5255
scale_down_schedule_expression = var.scale_down_schedule_expression
5356
minimum_running_time_in_minutes = var.minimum_running_time_in_minutes
5457
runner_extra_labels = var.runner_extra_labels
58+
59+
lambda_zip = var.runners_lambda_zip
60+
lambda_timeout_scale_up = var.runners_scale_up_lambda_timeout
61+
lambda_timeout_scale_down = var.runners_scale_down_lambda_timeout
5562
}
5663

5764
module "runner_binaries" {
@@ -62,6 +69,9 @@ module "runner_binaries" {
6269
tags = local.tags
6370

6471
distribution_bucket_name = "${var.environment}-dist-${random_string.random.result}"
72+
73+
lambda_zip = var.runner_binaries_syncer_lambda_zip
74+
lambda_timeout = var.runner_binaries_syncer_lambda_timeout
6575
}
6676

6777
resource "aws_resourcegroups_group" "resourcegroups_group" {

modules/runner-binaries-syncer/runner-binaries-syncer.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "aws_lambda_function" "syncer" {
99
role = aws_iam_role.syncer_lambda.arn
1010
handler = "index.handler"
1111
runtime = "nodejs12.x"
12-
timeout = var.lambda_timeoutp
12+
timeout = var.lambda_timeout
1313

1414
environment {
1515
variables = {

modules/runner-binaries-syncer/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ variable "lambda_zip" {
3131
default = null
3232
}
3333

34-
variable "lambda_timeoutp" {
34+
variable "lambda_timeout" {
3535
description = "Time out of the lambda in seconds."
3636
type = number
3737
default = 300

modules/webhook/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resource "aws_lambda_function" "webhook" {
5555
role = aws_iam_role.webhook_lambda.arn
5656
handler = "index.githubWebhook"
5757
runtime = "nodejs12.x"
58-
timeout = var.lambda_timeoutp
58+
timeout = var.lambda_timeout
5959

6060
environment {
6161
variables = {

modules/webhook/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ variable "lambda_zip" {
3636
default = null
3737
}
3838

39-
variable "lambda_timeoutp" {
39+
variable "lambda_timeout" {
4040
description = "Time out of the lambda in seconds."
4141
type = number
42-
default = 300
42+
default = 10
4343
}

variables.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,47 @@ variable "runner_extra_labels" {
5757
type = string
5858
default = ""
5959
}
60+
61+
62+
63+
variable "webhook_lambda_zip" {
64+
description = "File location of the wehbook lambda zip file."
65+
type = string
66+
default = null
67+
}
68+
69+
variable "webhook_lambda_timeout" {
70+
description = "Time out of the webhook lambda in seconds."
71+
type = number
72+
default = 10
73+
}
74+
75+
variable "runners_lambda_zip" {
76+
description = "File location of the lambda zip file for scaling runners."
77+
type = string
78+
default = null
79+
}
80+
81+
variable "runners_scale_up_lambda_timeout" {
82+
description = "Time out for the scale down lambda in seconds."
83+
type = number
84+
default = 60
85+
}
86+
87+
variable "runners_scale_down_lambda_timeout" {
88+
description = "Time out for the scale up lambda in seconds."
89+
type = number
90+
default = 60
91+
}
92+
93+
variable "runner_binaries_syncer_lambda_zip" {
94+
description = "File location of the binaries sync lambda zip file."
95+
type = string
96+
default = null
97+
}
98+
99+
variable "runner_binaries_syncer_lambda_timeout" {
100+
description = "Time out of the binaries sync lambda in seconds."
101+
type = number
102+
default = 300
103+
}

0 commit comments

Comments
 (0)