Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 11ace32

Browse files
feat: Update default runtime from nodejs18.x to nodejs20.x (#3791)
Update default lambda runtime to Node20 (LTS). - Updated tflint, fixed linting errors - Drop old terraform version 1.3.x from CI --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 45fd1cb commit 11ace32

File tree

16 files changed

+33
-24
lines changed

16 files changed

+33
-24
lines changed

Diff for: .github/workflows/terraform.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ jobs:
4646
run: apk add --no-cache tar
4747
continue-on-error: true
4848
- if: contains(matrix.terraform, '1.5.')
49-
uses: actions/cache@v4
49+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
5050
name: Cache TFLint plugin dir
5151
with:
5252
path: ~/.tflint.d/plugins
5353
key: tflint-${{ hashFiles('.tflint.hcl') }}
5454
- if: contains(matrix.terraform, '1.5.')
5555
name: Setup TFLint
56-
uses: terraform-linters/setup-tflint@v4
56+
uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0
5757
with:
5858
github_token: ${{ secrets.GITHUB_TOKEN }}
59-
- if: contains(matrix.terraform, '1.3.')
59+
- if: contains(matrix.terraform, '1.5.')
6060
name: Run TFLint
6161
run: |
6262
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl
@@ -67,7 +67,7 @@ jobs:
6767
strategy:
6868
fail-fast: false
6969
matrix:
70-
terraform: [1.3.2, "latest"]
70+
terraform: [1.5.6, "latest"]
7171
module:
7272
["ami-housekeeper", "download-lambda", "multi-runner", "runner-binaries-syncer", "runners", "setup-iam-permissions", "ssm", "webhook"]
7373
defaults:

Diff for: .tflint.hcl

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
config {
22
format = "compact"
33
module = true
4-
5-
64
}
75

86
plugin "aws" {
97
enabled = true
10-
version = "0.23.0"
8+
version = "0.30.0"
119
source = "github.com/terraform-linters/tflint-ruleset-aws"
1210
}
1311

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
169169
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. This key must be in the current account. | `string` | `null` | no |
170170
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
171171
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
172-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
172+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
173173
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
174174
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
175175
| <a name="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids) | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |
@@ -217,7 +217,8 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
217217
| <a name="input_runners_maximum_count"></a> [runners\_maximum\_count](#input\_runners\_maximum\_count) | The maximum number of runners that will be created. | `number` | `3` | no |
218218
| <a name="input_runners_scale_down_lambda_memory_size"></a> [runners\_scale\_down\_lambda\_memory\_size](#input\_runners\_scale\_down\_lambda\_memory\_size) | Memory size limit in MB for scale-down lambda. | `number` | `512` | no |
219219
| <a name="input_runners_scale_down_lambda_timeout"></a> [runners\_scale\_down\_lambda\_timeout](#input\_runners\_scale\_down\_lambda\_timeout) | Time out for the scale down lambda in seconds. | `number` | `60` | no |
220-
| <a name="input_runners_scale_up_Lambda_memory_size"></a> [runners\_scale\_up\_Lambda\_memory\_size](#input\_runners\_scale\_up\_Lambda\_memory\_size) | Memory size limit in MB for scale-up lambda. | `number` | `512` | no |
220+
| <a name="input_runners_scale_up_Lambda_memory_size"></a> [runners\_scale\_up\_Lambda\_memory\_size](#input\_runners\_scale\_up\_Lambda\_memory\_size) | Memory size limit in MB for scale-up lambda. | `number` | `null` | no |
221+
| <a name="input_runners_scale_up_lambda_memory_size"></a> [runners\_scale\_up\_lambda\_memory\_size](#input\_runners\_scale\_up\_lambda\_memory\_size) | Memory size limit in MB for scale-up lambda. | `number` | `512` | no |
221222
| <a name="input_runners_scale_up_lambda_timeout"></a> [runners\_scale\_up\_lambda\_timeout](#input\_runners\_scale\_up\_lambda\_timeout) | Time out for the scale up lambda in seconds. | `number` | `30` | no |
222223
| <a name="input_runners_ssm_housekeeper"></a> [runners\_ssm\_housekeeper](#input\_runners\_ssm\_housekeeper) | Configuration for the SSM housekeeper lambda. This lambda deletes token / JIT config from SSM.<br><br> `schedule_expression`: is used to configure the schedule for the lambda.<br> `enabled`: enable or disable the lambda trigger via the EventBridge.<br> `lambda_memory_size`: lambda memery size limit.<br> `lambda_timeout`: timeout for the lambda in seconds.<br> `config`: configuration for the lambda function. Token path will be read by default from the module. | <pre>object({<br> schedule_expression = optional(string, "rate(1 day)")<br> enabled = optional(bool, true)<br> lambda_memory_size = optional(number, 512)<br> lambda_timeout = optional(number, 60)<br> config = object({<br> tokenPath = optional(string)<br> minimumDaysOld = optional(number, 1)<br> dryRun = optional(bool, false)<br> })<br> })</pre> | <pre>{<br> "config": {}<br>}</pre> | no |
223224
| <a name="input_scale_down_schedule_expression"></a> [scale\_down\_schedule\_expression](#input\_scale\_down\_schedule\_expression) | Scheduler expression to check every x for scale down. | `string` | `"cron(*/5 * * * ? *)"` | no |

Diff for: main.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ module "ssm" {
124124
module "webhook" {
125125
source = "./modules/webhook"
126126
ssm_paths = {
127-
root = "${local.ssm_root_path}"
128-
webhook = "${var.ssm_paths.webhook}"
127+
root = local.ssm_root_path
128+
webhook = var.ssm_paths.webhook
129129
}
130130
prefix = var.prefix
131131
tags = local.tags
@@ -238,7 +238,7 @@ module "runners" {
238238
lambda_runtime = var.lambda_runtime
239239
lambda_architecture = var.lambda_architecture
240240
lambda_zip = var.runners_lambda_zip
241-
lambda_scale_up_memory_size = var.runners_scale_up_Lambda_memory_size
241+
lambda_scale_up_memory_size = coalesce(var.runners_scale_up_Lambda_memory_size, var.runners_scale_up_lambda_memory_size)
242242
lambda_scale_down_memory_size = var.runners_scale_down_lambda_memory_size
243243
lambda_timeout_scale_up = var.runners_scale_up_lambda_timeout
244244
lambda_timeout_scale_down = var.runners_scale_down_lambda_timeout

Diff for: modules/ami-housekeeper/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ No modules.
105105
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
106106
| <a name="input_lambda_memory_size"></a> [lambda\_memory\_size](#input\_lambda\_memory\_size) | Memory size linit in MB of the lambda. | `number` | `256` | no |
107107
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
108-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
108+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
109109
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
110110
| <a name="input_lambda_s3_key"></a> [lambda\_s3\_key](#input\_lambda\_s3\_key) | S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas. | `string` | `null` | no |
111111
| <a name="input_lambda_s3_object_version"></a> [lambda\_s3\_object\_version](#input\_lambda\_s3\_object\_version) | S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. | `string` | `null` | no |

Diff for: modules/ami-housekeeper/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ variable "lambda_s3_object_version" {
117117
variable "lambda_runtime" {
118118
description = "AWS Lambda runtime."
119119
type = string
120-
default = "nodejs18.x"
120+
default = "nodejs20.x"
121121
}
122122

123123
variable "lambda_architecture" {

Diff for: modules/multi-runner/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module "multi-runner" {
137137
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. | `string` | `null` | no |
138138
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
139139
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
140-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
140+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
141141
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
142142
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
143143
| <a name="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids) | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |

Diff for: modules/multi-runner/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ variable "log_level" {
309309
variable "lambda_runtime" {
310310
description = "AWS Lambda runtime."
311311
type = string
312-
default = "nodejs18.x"
312+
default = "nodejs20.x"
313313
}
314314

315315
variable "lambda_architecture" {

Diff for: modules/runner-binaries-syncer/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ No modules.
8989
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
9090
| <a name="input_lambda_memory_size"></a> [lambda\_memory\_size](#input\_lambda\_memory\_size) | Memory size of the lambda. | `number` | `256` | no |
9191
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
92-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
92+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
9393
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
9494
| <a name="input_lambda_schedule_expression"></a> [lambda\_schedule\_expression](#input\_lambda\_schedule\_expression) | Scheduler expression for action runner binary syncer. | `string` | `"cron(27 * * * ? *)"` | no |
9595
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |

Diff for: modules/runner-binaries-syncer/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ variable "lambda_principals" {
214214
variable "lambda_runtime" {
215215
description = "AWS Lambda runtime."
216216
type = string
217-
default = "nodejs18.x"
217+
default = "nodejs20.x"
218218
}
219219

220220
variable "lambda_architecture" {

Diff for: modules/runners/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ yarn run dist
167167
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | Key pair name | `string` | `null` | no |
168168
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. | `string` | `null` | no |
169169
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
170-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
170+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
171171
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
172172
| <a name="input_lambda_scale_down_memory_size"></a> [lambda\_scale\_down\_memory\_size](#input\_lambda\_scale\_down\_memory\_size) | Memory size limit in MB for scale down lambda. | `number` | `512` | no |
173173
| <a name="input_lambda_scale_up_memory_size"></a> [lambda\_scale\_up\_memory\_size](#input\_lambda\_scale\_up\_memory\_size) | Memory size limit in MB for scale-up lambda. | `number` | `512` | no |

Diff for: modules/runners/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ variable "disable_runner_autoupdate" {
549549
variable "lambda_runtime" {
550550
description = "AWS Lambda runtime."
551551
type = string
552-
default = "nodejs18.x"
552+
default = "nodejs20.x"
553553
}
554554

555555
variable "lambda_architecture" {

Diff for: modules/webhook/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ No modules.
8383
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. | `string` | `null` | no |
8484
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
8585
| <a name="input_lambda_memory_size"></a> [lambda\_memory\_size](#input\_lambda\_memory\_size) | Memory size limit in MB for lambda. | `number` | `256` | no |
86-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs18.x"` | no |
86+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs20.x"` | no |
8787
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `string` | `null` | no |
8888
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
8989
| <a name="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids) | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |

Diff for: modules/webhook/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ variable "log_level" {
151151
variable "lambda_runtime" {
152152
description = "AWS Lambda runtime."
153153
type = string
154-
default = "nodejs18.x"
154+
default = "nodejs20.x"
155155
}
156156

157157
variable "aws_partition" {

Diff for: variables.deprecated.tf

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# tflint-ignore: terraform_unused_declarations
12
variable "lambda_tracing_mode" {
23
description = "DEPRECATED: Replaced by `tracing_config`."
34
type = string
@@ -9,6 +10,7 @@ variable "lambda_tracing_mode" {
910
}
1011
}
1112

13+
# tflint-ignore: terraform_unused_declarations
1214
variable "enable_event_rule_binaries_syncer" {
1315
description = "DEPRECATED: Replaced by `state_event_rule_binaries_syncer`."
1416
type = bool
@@ -18,3 +20,11 @@ variable "enable_event_rule_binaries_syncer" {
1820
error_message = "DEPRECATED, Replaced by `state_event_rule_binaries_syncer`."
1921
}
2022
}
23+
24+
25+
# tflint-ignore: terraform_naming_convention
26+
variable "runners_scale_up_Lambda_memory_size" {
27+
description = "Memory size limit in MB for scale-up lambda."
28+
type = number
29+
default = null
30+
}

Diff for: variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ variable "runners_lambda_zip" {
100100
default = null
101101
}
102102

103-
variable "runners_scale_up_Lambda_memory_size" {
103+
variable "runners_scale_up_lambda_memory_size" {
104104
description = "Memory size limit in MB for scale-up lambda."
105105
type = number
106106
default = 512
@@ -694,7 +694,7 @@ variable "disable_runner_autoupdate" {
694694
variable "lambda_runtime" {
695695
description = "AWS Lambda runtime."
696696
type = string
697-
default = "nodejs18.x"
697+
default = "nodejs20.x"
698698
}
699699

700700
variable "lambda_architecture" {

0 commit comments

Comments
 (0)