Skip to content

Commit ca8e0e4

Browse files
authored
Lambda layer supports AWS Lambda Python 3.13 Runtime (#293)
*Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent c17ce69 commit ca8e0e4

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

.github/workflows/release_lambda.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
aws lambda publish-layer-version \
9999
--layer-name ${{ env.LAYER_NAME }} \
100100
--content S3Bucket=${{ env.BUCKET_NAME }},S3Key=aws-opentelemetry-python-layer.zip \
101-
--compatible-runtimes python3.10 python3.11 python3.12 \
101+
--compatible-runtimes python3.10 python3.11 python3.12 python3.13 \
102102
--compatible-architectures "arm64" "x86_64" \
103103
--license-info "Apache-2.0" \
104104
--description "AWS Distro of OpenTelemetry Lambda Layer for Python Runtime" \
@@ -184,16 +184,16 @@ jobs:
184184
with:
185185
name: layer.tf
186186
path: layer.tf
187-
- name: Commit changes
188-
env:
189-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190-
run: |
191-
git config user.name "github-actions[bot]"
192-
git config user.email "github-actions[bot]@users.noreply.github.com"
193-
mv layer.tf lambda-layer/terraform/lambda/
194-
git add lambda-layer/terraform/lambda/layer.tf
195-
git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
196-
git push
187+
# - name: Commit changes
188+
# env:
189+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190+
# run: |
191+
# git config user.name "github-actions[bot]"
192+
# git config user.email "github-actions[bot]@users.noreply.github.com"
193+
# mv layer.tf lambda-layer/terraform/lambda/
194+
# git add lambda-layer/terraform/lambda/layer.tf
195+
# git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
196+
# git push
197197
create-release:
198198
runs-on: ubuntu-latest
199199
needs: generate-release-note
@@ -205,16 +205,16 @@ jobs:
205205
echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
206206
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
207207
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
208-
- name: Create Tag
209-
run: |
210-
git config user.name "github-actions[bot]"
211-
git config user.email "github-actions[bot]@users.noreply.github.com"
212-
TAG_NAME="lambda-${SHORT_SHA}"
213-
git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
214-
git push origin "$TAG_NAME"
215-
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
216-
env:
217-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
# - name: Create Tag
209+
# run: |
210+
# git config user.name "github-actions[bot]"
211+
# git config user.email "github-actions[bot]@users.noreply.github.com"
212+
# TAG_NAME="lambda-${SHORT_SHA}"
213+
# git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
214+
# git push origin "$TAG_NAME"
215+
# echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
216+
# env:
217+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218218
- name: Create Release
219219
id: create_release
220220
uses: actions/create-release@v1

lambda-layer/src/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/sam/build-python3.12 AS python312
1+
FROM public.ecr.aws/sam/build-python3.13 AS python313
22

33
ADD . /workspace
44

@@ -19,6 +19,13 @@ RUN mkdir -p /build && \
1919
chmod 755 /build/otel-instrument && \
2020
rm -rf /build/python/urllib3*
2121

22+
FROM public.ecr.aws/sam/build-python3.12 AS python312
23+
24+
WORKDIR /workspace
25+
26+
COPY --from=python313 /build /build
27+
28+
RUN python3 -m compileall /build/python
2229

2330
FROM public.ecr.aws/sam/build-python3.11 AS python311
2431

lambda-layer/terraform/lambda/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ locals {
55
resource "aws_lambda_layer_version" "sdk_layer" {
66
layer_name = var.sdk_layer_name
77
filename = "${path.module}/../../src/build/aws-opentelemetry-python-layer.zip"
8-
compatible_runtimes = ["python3.10", "python3.11", "python3.12"]
8+
compatible_runtimes = ["python3.10", "python3.11", "python3.12", "python3.13"]
99
license_info = "Apache-2.0"
1010
source_code_hash = filebase64sha256("${path.module}/../../src/build/aws-opentelemetry-python-layer.zip")
1111
}

lambda-layer/terraform/lambda/variables.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variable "sdk_layer_name" {
22
type = string
33
description = "Name of published SDK layer"
4-
default = "aws-opentelemetry-distro-python"
4+
default = "AWSOpenTelemetryDistroPython"
55
}
66

77
variable "function_name" {
@@ -19,17 +19,11 @@ variable "architecture" {
1919
variable "runtime" {
2020
type = string
2121
description = "Python runtime version used for sample Lambda Function"
22-
default = "python3.12"
22+
default = "python3.13"
2323
}
2424

2525
variable "tracing_mode" {
2626
type = string
2727
description = "Lambda function tracing mode"
2828
default = "Active"
2929
}
30-
31-
variable "enable_collector_layer" {
32-
type = bool
33-
description = "Enables building and usage of a layer for the collector. If false, it means either the SDK layer includes the collector or it is not used."
34-
default = false
35-
}

0 commit comments

Comments
 (0)