Skip to content

Commit

Permalink
Change python version to 3.10 as thats the latest supported by terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
sakibstark11 committed Jan 7, 2024
1 parent ee82c78 commit 00e6291
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
terraform 1.4.2
python 3.12.1
python 3.10.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-bullseye
FROM --platform=arm64 python:3.10-bullseye

RUN apt-get update
RUN apt-get install -y make zip unzip wget --no-install-recommends
Expand Down
3 changes: 1 addition & 2 deletions src/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def self_gem(gems_message: GemsMessage):
return slash_command_response(
f"**{emojis.FACE_HOLDING_BACK_TEARS} {gems_message.sender_username} to **"
f"themselves; they must've needed this one but we don't judge: "
f"{replace_gem_template_with_real_gem(gems_message.gem_message,
gems_message.gem_count)}"
f"{replace_gem_template_with_real_gem(gems_message.gem_message, gems_message.gem_count)}"
)
return slash_command_response(f"**{emojis.X} You can not give more than one {emojis.GEM}s to yourself in one day {emojis.X}**")

Expand Down
2 changes: 1 addition & 1 deletion terraform/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "aws_lambda_function" "lambda_functions" {
layers = [aws_lambda_layer_version.lambda_layer.arn]
publish = lookup(each.value, "publish_lambda", false)
reserved_concurrent_executions = lookup(each.value, "reserved_concurrency", -1)
architectures = ["arm64"]
architectures = ["x86_64"]
environment {
variables = lookup(each.value, "env_variables", {})
}
Expand Down
5 changes: 3 additions & 2 deletions terraform/lambda_layer.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
lambda_python_version = "python3.12"
lambda_python_version = "python3.10"
requirements_filepath = "${path.module}/../requirements.txt"
lambda_layer_zipfile_name = "craftsmen-bot-layer"

Expand All @@ -14,7 +14,8 @@ resource "null_resource" "build_lambda_layer" {
}

triggers = {
run_when = filemd5(local.requirements_filepath)
run_when_dependency = filemd5(local.requirements_filepath)
run_when_source = sha1(join("", [for f in fileset(path.root, "${path.module}/../src/**") : filesha1(f)]))
}
}

Expand Down

0 comments on commit 00e6291

Please sign in to comment.