Skip to content

Commit ca3fe21

Browse files
fix: set proper architecture for lambda (#109)
1 parent 09da3b1 commit ca3fe21

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

modules/platform/ec2_deployment/lambda/update_ssm_ami_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def lambda_handler(event, context):
3333

3434
try:
3535
current_ssm = ssm.get_parameter(Name=ssm_id)['Parameter']['Value']
36-
except ssm.exceptions.ParameterNotFound:
37-
current_ssm = None
36+
except ssm.exceptions.ParameterNotFound as e:
37+
raise RuntimeError(f'SSM parameter not found: {ssm_id}') from e
3838

3939
if current_ssm != new_ami_id:
4040
ssm.put_parameter(

modules/platform/ec2_deployment/update_ssm_ami_id.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ module "update_runner_ami_lambda" {
1818
function_name = "${var.runner_configs.prefix}-update-runner-ami"
1919
handler = "update_ssm_ami_id.lambda_handler"
2020
runtime = "python3.11"
21+
architectures = ["x86_64"]
2122

2223
source_path = [{
2324
path = "${path.module}/lambda"
2425
pip_requirements = "${path.module}/lambda/requirements.txt"
2526
}]
27+
build_in_docker = true
28+
docker_pip_cache = true
2629

2730
logging_log_group = aws_cloudwatch_log_group.update_runner_ami_lambda.name
2831
use_existing_cloudwatch_log_group = true

modules/platform/forge_runners/global_lock.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,15 @@ module "clean_global_lock_lambda" {
7676
handler = "github_clean_global_lock.lambda_handler"
7777
runtime = "python3.11"
7878
timeout = 120
79+
architectures = ["x86_64"]
7980

8081
source_path = [{
8182
path = "${path.module}/lambda"
8283
pip_requirements = "${path.module}/lambda/requirements.txt"
8384
}]
85+
build_in_docker = true
86+
docker_image = "public.ecr.aws/lambda/python:3.11"
87+
docker_pip_cache = false
8488

8589
logging_log_group = aws_cloudwatch_log_group.clean_global_lock_lambda.name
8690
use_existing_cloudwatch_log_group = true

modules/platform/forge_runners/lambda/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--only-binary=:all:
12
PyJWT==2.10.1
23
requests==2.32.4
34
boto3==1.38.14

modules/platform/forge_runners/register_repo_runner_group.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ module "register_github_app_runner_group_lambda" {
66
handler = "github_app_runner_group.lambda_handler"
77
runtime = "python3.11"
88
timeout = 120
9+
architectures = ["x86_64"]
910

1011
source_path = [{
1112
path = "${path.module}/lambda"
1213
pip_requirements = "${path.module}/lambda/requirements.txt"
1314
}]
15+
build_in_docker = true
16+
docker_image = "public.ecr.aws/lambda/python:3.11"
17+
docker_pip_cache = false
1418

1519
logging_log_group = aws_cloudwatch_log_group.register_github_app_runner_group_lambda.name
1620
use_existing_cloudwatch_log_group = true

0 commit comments

Comments
 (0)