Skip to content

Commit b4ef4e4

Browse files
authored
feat: Update Python lambda runtime from 3.8 to 3.11 (#225)
* feat: Update Python lambda runtime from `3.8` to `3.11` * fix: Update CI versions to support 3.11
1 parent 1f70e78 commit b4ef4e4

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

.github/workflows/unit-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

25-
- name: Set up Python 3.8
26-
uses: actions/setup-python@v4
25+
- name: Set up Python 3.11
26+
uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.8
28+
python-version: 3.11
2929

3030
- name: Install pipenv
3131
run: |

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Doing serverless with Terraform? Check out [serverless.tf framework](https://ser
88

99
## Supported Features
1010

11-
- AWS Lambda runtime Python 3.8
11+
- AWS Lambda runtime Python 3.11
1212
- Create new SNS topic or use existing one
1313
- Support plaintext and encrypted version of Slack webhook URL
1414
- Most of Slack message options are customizable
@@ -18,7 +18,6 @@ Doing serverless with Terraform? Check out [serverless.tf framework](https://ser
1818
- AWS CloudWatch LogMetrics Alarms
1919
- AWS GuardDuty Findings
2020

21-
2221
## Usage
2322

2423
```hcl
@@ -38,11 +37,11 @@ module "notify_slack" {
3837

3938
[Terraform Cloud Agents](https://www.terraform.io/docs/cloud/workspaces/agent.html) are a paid feature, available as part of the Terraform Cloud for Business upgrade package.
4039

41-
This module requires Python 3.8. You can customize [tfc-agent](https://hub.docker.com/r/hashicorp/tfc-agent) to include Python using this sample `Dockerfile`:
40+
This module requires Python 3.11. You can customize [tfc-agent](https://hub.docker.com/r/hashicorp/tfc-agent) to include Python using this sample `Dockerfile`:
4241

43-
```
42+
```Dockerfile
4443
FROM hashicorp/tfc-agent:latest
45-
RUN apt-get -y update && apt-get -y install python3.8 python3-pip
44+
RUN apt-get -y update && apt-get -y install python3.11 python3-pip
4645
ENTRYPOINT ["/bin/tfc-agent"]
4746
```
4847

functions/.pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 120
3-
target-version = ['py38']
3+
target-version = ['py311']
44
include = '\.pyi?$'
55
verbose = true
66
exclude = '''

functions/Pipfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ name = "pypi"
66
[packages]
77

88
[dev-packages]
9-
boto3 = "~=1.20"
10-
botocore = "~=1.23"
9+
boto3 = "~=1.34"
10+
botocore = "~=1.34"
1111
black = "*"
1212
flake8 = "*"
1313
isort = "*"
@@ -18,7 +18,7 @@ radon = "*"
1818
snapshottest = "~=0.6"
1919

2020
[requires]
21-
python_version = "3.8"
21+
python_version = "3.11"
2222

2323
[scripts]
2424
test = "python3 -m pytest --cov --cov-report=term"

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module "lambda" {
9191
handler = "${local.lambda_handler}.lambda_handler"
9292
source_path = var.lambda_source_path != null ? "${path.root}/${var.lambda_source_path}" : "${path.module}/functions/notify_slack.py"
9393
recreate_missing_package = var.recreate_missing_package
94-
runtime = "python3.8"
94+
runtime = "python3.11"
9595
architectures = var.architectures
9696
timeout = 30
9797
kms_key_arn = var.kms_key_arn

0 commit comments

Comments
 (0)