Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ body:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
validations:
required: true
- type: dropdown
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/static_typing.yml
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ body:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
validations:
required: true
- type: input
13 changes: 8 additions & 5 deletions .github/workflows/layer_govcloud.yml
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
@@ -94,6 +95,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
@@ -110,7 +112,7 @@ jobs:
- name: Verify Layer Signature
run: |
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
@@ -144,7 +146,7 @@ jobs:
run: |
REMOTE_SHA=$(aws --region us-gov-east-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-east-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
aws --region us-gov-east-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-east-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --output table
copy_west:
@@ -162,6 +164,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
@@ -179,7 +182,7 @@ jobs:
- name: Verify Layer Signature
run: |
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
@@ -213,5 +216,5 @@ jobs:
run: |
REMOTE_SHA=$(aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --output table
test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --output table
3 changes: 3 additions & 0 deletions .github/workflows/layer_govcloud_verify.yml
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
@@ -63,6 +64,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
@@ -94,6 +96,7 @@ jobs:
- AWSLambdaPowertoolsPythonV3-python310
- AWSLambdaPowertoolsPythonV3-python311
- AWSLambdaPowertoolsPythonV3-python312
- AWSLambdaPowertoolsPythonV3-python313
arch:
- arm64
- x86_64
2 changes: 1 addition & 1 deletion .github/workflows/publish_v3_layer.yml
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]
defaults:
run:
working-directory: ./layer_v3
2 changes: 1 addition & 1 deletion .github/workflows/quality_check.yml
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]
env:
PYTHON: "${{ matrix.python-version }}"
permissions:
8 changes: 4 additions & 4 deletions .github/workflows/quality_code_cdk_constructor.yml
Original file line number Diff line number Diff line change
@@ -15,25 +15,25 @@ name: Code quality - CDK constructor
on:
pull_request:
paths:
- "layer/layer_constructors/**"
- "layer_v3/layer_constructors/**"
branches:
- develop
push:
paths:
- "layer/layer_constructors/**"
- "layer_v3/layer_constructors/**"
branches:
- develop

permissions:
contents: read

jobs:
quality_check:
quality_check_cdk:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.12"]
env:
PYTHON: "${{ matrix.python-version }}"
permissions:
2 changes: 1 addition & 1 deletion .github/workflows/reusable_deploy_v3_layer_stack.yml
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ jobs:
"eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3",
"il-central-1", "me-central-1", "me-south-1", "sa-east-1", "us-east-1",
"us-east-2", "us-west-1", "us-west-2"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]
include:
- region: "af-south-1"
has_arm64_support: "true"
4 changes: 2 additions & 2 deletions .github/workflows/reusable_deploy_v3_sar.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ name: Deploy V3 SAR
#
# 1. This workflow starts after the layer artifact is produced on `publish_v3_layer`
# 2. We use the same layer artifact to ensure the SAR app is consistent with the published Lambda Layer
# 3. We publish the SAR for 3.8 to 3.12 Python runtime and both x86_64 and arm64 (see `matrix` section)
# 3. We publish the SAR for 3.8 to 3.13 Python runtime and both x86_64 and arm64 (see `matrix` section)
# 4. We use `sam package` and `sam publish` to publish the SAR app
# 5. We remove the previous Canary stack (if present) and deploy a new one to test the SAR App. We retain the Canary in the account for debugging purposes
# 6. Finally the published SAR app is made public on the PROD environment
@@ -72,7 +72,7 @@ jobs:
strategy:
matrix:
architecture: ["x86_64", "arm64"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false # needed so if a version fails, the others will still be able to complete and cleanup
matrix:
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
version: ["3.8", "3.9", "3.10", "3.11", "3.12","3.13"]
if: ${{ github.actor != 'dependabot[bot]' && github.repository == 'aws-powertools/powertools-lambda-python' }}
steps:
- name: "Checkout"
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ target:

dev:
pip install --upgrade pip pre-commit poetry
poetry config --local virtualenvs.in-project true
@$(MAKE) dev-version-plugin
poetry install --extras "all redis datamasking"
pre-commit install
2 changes: 1 addition & 1 deletion aws_lambda_powertools/event_handler/openapi/models.py
Original file line number Diff line number Diff line change
@@ -390,7 +390,7 @@ class HTTPBase(SecurityBase):
scheme: str


class HTTPBearer(HTTPBase):
class HTTPBearer(HTTPBase): # type: ignore[override]
scheme: Literal["bearer"] = "bearer"
bearerFormat: Optional[str] = None

2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parameters/dynamodb.py
Original file line number Diff line number Diff line change
@@ -230,4 +230,4 @@ def _get_multiple(self, path: str, **sdk_options) -> dict[str, str]:

# maintenance: look for better ways to correctly type DynamoDB multiple return types
# without a breaking change within ABC return type
return {item[self.sort_attr]: item[self.value_attr] for item in items}
return {item[self.sort_attr]: item[self.value_attr] for item in items} # type: ignore[misc]
Original file line number Diff line number Diff line change
@@ -14,16 +14,16 @@ class CloudFormationCustomResourceBaseModel(BaseModel):
resource_properties: Union[Dict[str, Any], BaseModel, None] = Field(None, alias="ResourceProperties")


class CloudFormationCustomResourceCreateModel(CloudFormationCustomResourceBaseModel):
class CloudFormationCustomResourceCreateModel(CloudFormationCustomResourceBaseModel): # type: ignore[override]
request_type: Literal["Create"] = Field(..., alias="RequestType")


class CloudFormationCustomResourceDeleteModel(CloudFormationCustomResourceBaseModel):
class CloudFormationCustomResourceDeleteModel(CloudFormationCustomResourceBaseModel): # type: ignore[override]
request_type: Literal["Delete"] = Field(..., alias="RequestType")
physical_resource_id: str = Field(..., alias="PhysicalResourceId")


class CloudFormationCustomResourceUpdateModel(CloudFormationCustomResourceBaseModel):
class CloudFormationCustomResourceUpdateModel(CloudFormationCustomResourceBaseModel): # type: ignore[override]
request_type: Literal["Update"] = Field(..., alias="RequestType")
physical_resource_id: str = Field(..., alias="PhysicalResourceId")
old_resource_properties: Union[Dict[str, Any], BaseModel, None] = Field(None, alias="OldResourceProperties")
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parser/models/s3.py
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ class S3EventNotificationEventBridgeDetailModel(BaseModel):
destination_access_tier: Optional[str] = Field(None, alias="destination-access-tier")


class S3EventNotificationEventBridgeModel(EventBridgeModel):
class S3EventNotificationEventBridgeModel(EventBridgeModel): # type: ignore[override]
detail: S3EventNotificationEventBridgeDetailModel


Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
from aws_lambda_powertools.utilities.parser.models.sqs import SqsModel, SqsRecordModel


class S3SqsEventNotificationRecordModel(SqsRecordModel):
class S3SqsEventNotificationRecordModel(SqsRecordModel): # type: ignore[override]
body: Json[S3Model]


class S3SqsEventNotificationModel(SqsModel):
class S3SqsEventNotificationModel(SqsModel): # type: ignore[override]
Records: List[S3SqsEventNotificationRecordModel]
8 changes: 7 additions & 1 deletion docs/automation.md
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ This is a snapshot of our automated checks at a glance.
To build and deploy the Lambda Layers, we run a pipeline with the following steps:

* We fetch the latest PyPi release and use it as the source for our layer.
* We build Python versions ranging from **3.8 to 3.12** for x86_64 and arm64 architectures. This is necessary because we use pre-compiled libraries like **Pydantic** and **Cryptography**, which require specific Python versions for each layer.
* We build Python versions ranging from **3.8 to 3.13** for x86_64 and arm64 architectures. This is necessary because we use pre-compiled libraries like **Pydantic** and **Cryptography**, which require specific Python versions for each layer.
* We provide layer distributions for both the **x86_64** and **arm64** architectures.
* For each Python version, we create a single CDK package containing both x86_64 and arm64 assets to optimize deployment performance.

@@ -111,6 +111,7 @@ graph LR
Fetch --> P310[<strong>Python 3.10</strong>]
Fetch --> P311[<strong>Python 3.11</strong>]
Fetch --> P312[<strong>Python 3.12</strong>]
Fetch --> P313[<strong>Python 3.13</strong>]
subgraph build ["LAYER BUILD"]
P38 --> P38x86[build x86_64]
@@ -124,6 +125,8 @@ graph LR
P311 --> P311arm64[build arm64]
P312 --> P312x86[build x86_64]
P312 --> P312arm64[build arm64]
P313 --> P313x86[build x86_64]
P313 --> P313arm64[build arm64]
P38x86 --> CDKP1[CDK Package]
P38arm64 --> CDKP1[CDK Package]
P39x86 --> CDKP2[CDK Package]
@@ -134,6 +137,8 @@ graph LR
P311arm64 --> CDKP4[CDK Package]
P312x86 --> CDKP5[CDK Package]
P312arm64 --> CDKP5[CDK Package]
P313x86 --> CDKP6[CDK Package]
P313arm64 --> CDKP6[CDK Package]
end
subgraph beta ["BETA (all regions)"]
@@ -142,6 +147,7 @@ graph LR
CDKP3 --> DeployBeta
CDKP4 --> DeployBeta
CDKP5 --> DeployBeta
CDKP6 --> DeployBeta
DeployBeta --> RunBetaCanary["Beta canary tests<br> <i>(all packages)</i>"]
end
subgraph prod ["PROD (all regions)"]
32 changes: 32 additions & 0 deletions docs/includes/_layer_homepage_arm64.md
Original file line number Diff line number Diff line change
@@ -160,3 +160,35 @@
| **`us-east-2`** | **arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64:3**{: .copyMe}:clipboard: |
| **`us-west-1`** | **arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64:3**{: .copyMe}:clipboard: |
| **`us-west-2`** | **arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64:3**{: .copyMe}:clipboard: |

=== "Python 3.13"

| Region | Layer ARN |
| -------------------- | --------------------------------------------------------------------------------------------------------------- |
| **`af-south-1`** | **arn:aws:lambda:af-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-east-1`** | **arn:aws:lambda:ap-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-1`** | **arn:aws:lambda:ap-northeast-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-2`** | **arn:aws:lambda:ap-northeast-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-3`** | **arn:aws:lambda:ap-northeast-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-south-1`** | **arn:aws:lambda:ap-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-south-2`** | **arn:aws:lambda:ap-south-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-1`** | **arn:aws:lambda:ap-southeast-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-2`** | **arn:aws:lambda:ap-southeast-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-3`** | **arn:aws:lambda:ap-southeast-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`ca-central-1`** | **arn:aws:lambda:ca-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-central-1`** | **arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-central-2`** | **arn:aws:lambda:eu-central-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-north-1`** | **arn:aws:lambda:eu-north-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-south-1`** | **arn:aws:lambda:eu-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-south-2`** | **arn:aws:lambda:eu-south-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-west-1`** | **arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-west-2`** | **arn:aws:lambda:eu-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`eu-west-3`** | **arn:aws:lambda:eu-west-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`il-central-1`** | **arn:aws:lambda:il-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`me-central-1`** | **arn:aws:lambda:me-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`me-south-1`** | **arn:aws:lambda:me-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`sa-east-1`** | **arn:aws:lambda:sa-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`us-east-1`** | **arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`us-east-2`** | **arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`us-west-1`** | **arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
| **`us-west-2`** | **arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-arm64:3**{: .copyMe}:clipboard: |
34 changes: 34 additions & 0 deletions docs/includes/_layer_homepage_x86.md
Original file line number Diff line number Diff line change
@@ -170,3 +170,37 @@
| **`us-east-2`** | **arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-x86_64:3**{: .copyMe}:clipboard: |
| **`us-west-1`** | **arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-x86_64:3**{: .copyMe}:clipboard: |
| **`us-west-2`** | **arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-x86_64:3**{: .copyMe}:clipboard: |

=== "Python 3.13"

| Region | Layer ARN |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| **`af-south-1`** | **arn:aws:lambda:af-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-east-1`** | **arn:aws:lambda:ap-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-1`** | **arn:aws:lambda:ap-northeast-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-2`** | **arn:aws:lambda:ap-northeast-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-northeast-3`** | **arn:aws:lambda:ap-northeast-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-south-1`** | **arn:aws:lambda:ap-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-south-2`** | **arn:aws:lambda:ap-south-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-1`** | **arn:aws:lambda:ap-southeast-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-2`** | **arn:aws:lambda:ap-southeast-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-3`** | **arn:aws:lambda:ap-southeast-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ap-southeast-4`** | **arn:aws:lambda:ap-southeast-4:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ca-central-1`** | **arn:aws:lambda:ca-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`ca-west-1`** | **arn:aws:lambda:ca-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-central-1`** | **arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-central-2`** | **arn:aws:lambda:eu-central-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-north-1`** | **arn:aws:lambda:eu-north-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-south-1`** | **arn:aws:lambda:eu-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-south-2`** | **arn:aws:lambda:eu-south-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-west-1`** | **arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-west-2`** | **arn:aws:lambda:eu-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`eu-west-3`** | **arn:aws:lambda:eu-west-3:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`il-central-1`** | **arn:aws:lambda:il-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`me-central-1`** | **arn:aws:lambda:me-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`me-south-1`** | **arn:aws:lambda:me-south-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`sa-east-1`** | **arn:aws:lambda:sa-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`us-east-1`** | **arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`us-east-2`** | **arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`us-west-1`** | **arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
| **`us-west-2`** | **arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:3**{: .copyMe}:clipboard: |
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc

[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install), and remove duplicate dependencies [already available in the Lambda runtime](https://github.com/aws-powertools/powertools-lambda-layer-cdk/blob/d24716744f7d1f37617b4998c992c4c067e19e64/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.

For the latter, make sure to replace `{region}` with your AWS region, e.g., `eu-west-1`, and the `{python_version}` without the period (.), e.g., `python312` for `Python 3.12`.
For the latter, make sure to replace `{region}` with your AWS region, e.g., `eu-west-1`, and the `{python_version}` without the period (.), e.g., `python313` for `Python 3.13`.

| Architecture | Layer ARN |
| ------------ | --------------------------------------------------------------------------------------------------------- |
@@ -76,7 +76,7 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc

[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install), and remove duplicate dependencies [already available in the Lambda runtime](https://github.com/aws-powertools/powertools-lambda-layer-cdk/blob/d24716744f7d1f37617b4998c992c4c067e19e64/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.

For the latter, make sure to replace `{python_version}` without the period (.), e.g., `python312` for `Python 3.12`.
For the latter, make sure to replace `{python_version}` without the period (.), e.g., `python313` for `Python 3.13`.

**AWS GovCloud (us-gov-east-1)**

@@ -267,7 +267,7 @@ In this context, `[aws-sdk]` is an alias to the `boto3` package. Due to dependen

### Lambda Layer

[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install) for Python versions from **3.8 to 3.12**, as well as for both **arm64 and x86_64** architectures, to ensure compatibility. We also remove duplicate dependencies [already available in the Lambda runtime](https://github.com/aws-powertools/powertools-lambda-layer-cdk/blob/d24716744f7d1f37617b4998c992c4c067e19e64/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install) for Python versions from **3.8 to 3.13**, as well as for both **arm64 and x86_64** architectures, to ensure compatibility. We also remove duplicate dependencies [already available in the Lambda runtime](https://github.com/aws-powertools/powertools-lambda-layer-cdk/blob/d24716744f7d1f37617b4998c992c4c067e19e64/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.

=== "x86_64"
--8<-- "docs/includes/_layer_homepage_x86.md"
4 changes: 2 additions & 2 deletions docs/tutorial/index.md
Original file line number Diff line number Diff line change
@@ -20,11 +20,11 @@ Let's clone our sample project before we add one feature at a time.
Bootstrap directly via SAM CLI:

```shell
sam init --app-template hello-world-powertools-python --name sam-app --package-type Zip --runtime python3.12 --no-tracing
sam init --app-template hello-world-powertools-python --name sam-app --package-type Zip --runtime python3.13 --no-tracing
```

```bash title="Use SAM CLI to initialize the sample project"
sam init --runtime python3.12 --dependency-manager pip --app-template hello-world --name powertools-quickstart
sam init --runtime python3.13 --dependency-manager pip --app-template hello-world --name powertools-quickstart
```

### Project structure
4 changes: 3 additions & 1 deletion docs/upgrade.md
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ We have stopped exporting Pydantic objects directly from `aws_lambda_powertools.

!!! note "No code changes required"

To give you better a better experience, we're now building Powertools for AWS Lambda (Python)'s Lambda layers for specific Python versions (`3.8-3.12`) and architectures (`x86_64` & `arm64`).
To give you better a better experience, we're now building Powertools for AWS Lambda (Python)'s Lambda layers for specific Python versions (`3.8-3.13`) and architectures (`x86_64` & `arm64`).

This also allows us to include architecture-specific versions of both Pydantic v2 and AWS Encryption SDK and give you a more streamlined setup.

@@ -121,11 +121,13 @@ To take advantage of the new layers, you need to update your functions or deploy
| x86_64 | 3.10 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python310-x86_64:{version} |
| x86_64 | 3.11 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python311-x86_64:{version} |
| x86_64 | 3.12 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-x86_64:{version} |
| x86_64 | 3.13 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-x86_64:{version} |
| arm64 | 3.8 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python38-arm64:{version} |
| arm64 | 3.9 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python39-arm64:{version} |
| arm64 | 3.10 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python310-arm64:{version} |
| arm64 | 3.11 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python311-arm64:{version} |
| arm64 | 3.12 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64:{version} |
| arm64 | 3.13 | arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64:{version} |

## Event Handler: headers are case-insensitive

4 changes: 2 additions & 2 deletions docs/versioning.md
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@ Most AWS SDKs have underlying dependencies, such as language runtimes, AWS Lambd

The following terms are used to classify underlying third party dependencies:

* [**AWS Lambda Runtime**](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html): Examples include `nodejs20.x`, `python3.12`, etc.
* **Language Runtime**: Examples include Python 3.12, NodeJS 20, Java 17, .NET Core, etc.
* [**AWS Lambda Runtime**](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html): Examples include `nodejs20.x`, `python3.13`, etc.
* **Language Runtime**: Examples include Python 3.13, NodeJS 20, Java 17, .NET Core, etc.
* **Third party Library**: Examples include Pydantic, AWS X-Ray SDK, AWS Encryption SDK, Middy.js, etc.

Powertools for AWS Lambda follows the [AWS Lambda Runtime deprecation policy cycle](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy), when it comes to Language Runtime. This means we will stop supporting their respective deprecated Language Runtime _(e.g., `python37`)_ without increasing the major SDK version.
4 changes: 2 additions & 2 deletions examples/batch_processing/src/pydantic_dynamodb.py
Original file line number Diff line number Diff line change
@@ -31,12 +31,12 @@ def transform_message_to_dict(cls, value: Dict[Literal["S"], str]):
return json.loads(value["S"])


class OrderDynamoDBChangeRecord(DynamoDBStreamChangedRecordModel):
class OrderDynamoDBChangeRecord(DynamoDBStreamChangedRecordModel): # type: ignore[override]
NewImage: Optional[OrderDynamoDB]
OldImage: Optional[OrderDynamoDB]


class OrderDynamoDBRecord(DynamoDBStreamRecordModel):
class OrderDynamoDBRecord(DynamoDBStreamRecordModel): # type: ignore[override]
dynamodb: OrderDynamoDBChangeRecord


4 changes: 2 additions & 2 deletions examples/batch_processing/src/pydantic_kinesis.py
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@ class Order(BaseModel):
item: dict


class OrderKinesisPayloadRecord(KinesisDataStreamRecordPayload):
class OrderKinesisPayloadRecord(KinesisDataStreamRecordPayload): # type: ignore[override]
data: Json[Order]


class OrderKinesisRecord(KinesisDataStreamRecord):
class OrderKinesisRecord(KinesisDataStreamRecord): # type: ignore[override]
kinesis: OrderKinesisPayloadRecord


2 changes: 1 addition & 1 deletion examples/batch_processing/src/pydantic_sqs.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class Order(BaseModel):
item: dict


class OrderSqsRecord(SqsRecordModel):
class OrderSqsRecord(SqsRecordModel): # type: ignore[override]
body: Json[Order] # deserialize order data from JSON string


Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@


# Define a custom EventBridge model by extending the built-in EventBridgeModel
class MyCustomEventBridgeModel(EventBridgeModel):
class MyCustomEventBridgeModel(EventBridgeModel): # type: ignore[override]
detail_type: str = Field(alias="detail-type")
source: str
detail: dict
3 changes: 2 additions & 1 deletion layer/sar/template.txt
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ Metadata:
SourceCodeUrl: https://github.com/aws-powertools/powertools-lambda-python

Transform: AWS::Serverless-2016-10-31
Description: AWS Lambda Layer for aws-lambda-powertools with python 3.12, 3.11, 3.10, 3.9 or 3.8
Description: AWS Lambda Layer for aws-lambda-powertools with python 3.13, 3.12, 3.11, 3.10, 3.9 or 3.8

Resources:
LambdaLayer:
@@ -24,6 +24,7 @@ Resources:
LayerName: <SAR_APP_NAME>
ContentUri: <LAYER_CONTENT_PATH>
CompatibleRuntimes:
- python3.13
- python3.12
- python3.11
- python3.10
45 changes: 45 additions & 0 deletions layer_v3/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# First stage: setting the base image
ARG PYTHON_VERSION=""

FROM public.ecr.aws/lambda/python:${PYTHON_VERSION} AS base_build

# Second stage: building the layer
FROM base_build

ARG PYTHON_VERSION=""
ARG PACKAGE_SUFFIX=""

USER root
WORKDIR /tmp

# PACKAGE_SUFFIX = '[all]==3.0.0'
# PACKAGE_SUFFIX = '[all] @ git+https://github.com/awslabs/aws-lambda-powertools-python@develop'
# PACKAGE_SUFFIX = '[all]'
# PACKAGE_SUFFIX = '=='3.0.0'
# PACKAGE_SUFFIX = ' @ git+https://github.com/awslabs/aws-lambda-powertools-python@develop'
# PACKAGE_SUFFIX = ''

# PYTHON_VERSION = 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13

# Installing libs based on base image; We must use dnf for AL2023 (Python 3.12+)
COPY install_libraries.sh .
RUN chmod a+x /tmp/install_libraries.sh
RUN /bin/sh /tmp/install_libraries.sh

# Install cython to generate native code
RUN pip install --upgrade pip wheel && pip install --upgrade cython
# Optimize binary size and strip debugging symbols for optimum size
RUN CFLAGS="-Os -g0 -s" pip install -t /asset/python "aws-lambda-powertools${PACKAGE_SUFFIX}"

# Removing nonessential files
RUN cd /asset/python && \
# remove boto3 and botocore (already available in Lambda Runtime)
rm -rf boto* && \
# remove boto3 dependencies
rm -rf s3transfer* *dateutil* urllib3* six* jmespath* && \
# remove debugging symbols
find . -name '*.so' -type f -exec strip "{}" \; && \
# remove tests
find . -wholename "*/tests/*" -type f -delete && \
# remove python bytecode
find . -regex '^.*\(__pycache__\|\.py[co]\)$' -delete
45 changes: 45 additions & 0 deletions layer_v3/docker/install_libraries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh

al2_versions=("3.8" "3.9" "3.10" "3.11")

# Flag to indicate if the version is al2 or not
is_al2=0

for version in "${al2_versions[@]}"; do
if [ "$PYTHON_VERSION" = "$version" ]; then
is_al2=1
break
fi
done

if [ "$is_al2" -eq 1 ]; then
yum update -y && yum install -y zip unzip wget tar gzip binutils
yum install -y \
boost-devel \
jemalloc-devel \
bison \
make \
gcc \
gcc-c++ \
flex \
autoconf \
zip \
git \
ninja-build

else
dnf update -y && dnf install -y zip unzip wget tar gzip binutils
dnf install -y \
boost-devel \
jemalloc-devel \
bison \
make \
gcc \
gcc-c++ \
flex \
autoconf \
zip \
git \
ninja-build

fi
2 changes: 2 additions & 0 deletions layer_v3/layer/canary_stack.py
Original file line number Diff line number Diff line change
@@ -141,6 +141,8 @@ def __init__(
runtime = Runtime.PYTHON_3_11
elif python_version == "python3.12":
runtime = Runtime.PYTHON_3_12
elif python_version == "python3.13":
runtime = Runtime.PYTHON_3_13
else:
raise ValueError("Unsupported Python version")

2 changes: 2 additions & 0 deletions layer_v3/layer/layer_stack.py
Original file line number Diff line number Diff line change
@@ -94,6 +94,8 @@ def __init__(
python_version = Runtime.PYTHON_3_11
if python_version == "python3.12":
python_version = Runtime.PYTHON_3_12
if python_version == "python3.13":
python_version = Runtime.PYTHON_3_13

has_arm64_support = CfnParameter(
self,
13 changes: 7 additions & 6 deletions layer_v3/layer_constructors/layer_stack.py
Original file line number Diff line number Diff line change
@@ -22,19 +22,20 @@ class LambdaPowertoolsLayerPythonV3(lambda_.LayerVersion):
Attributes:
scope (Construct): The scope in which to define this construct.
construct_id (str): The scoped construct ID. Must be unique amongst siblings in the same scope.
python_version (lambda_.Runtime): The Python runtime version for the layer. Defaults to Python 3.12.
python_version (lambda_.Runtime): The Python runtime version for the layer. Defaults to Python 3.13.
include_extras (bool): Whether to include extra dependencies. Defaults to True.
architecture (lambda_.Architecture): The compatible Lambda architecture. Defaults to x86_64.
powertools_version (str): The version of Powertools to use. If empty, uses the latest version.
layer_name (str): Custom name for the Lambda Layer. If empty, a default name will be used.
layer_name (str): Custom name for the Lambda Layer. If empty, a default name will be used in the layer.
Example:
>>> app = cdk.App()
>>> LambdaPowertoolsLayerPythonV3(app, "PowertoolsLayer",
... python_version=lambda_.Runtime.PYTHON_3_11,
... include_extras=False,
... python_version=lambda_.Runtime.PYTHON_3_13,
... include_extras=True,
... architecture=lambda_.Architecture.ARM_64,
... powertools_version="2.10.0",
... powertools_version="3.0.0",
... layer_name="MyCustomPowertoolsLayer")
"""
@@ -43,7 +44,7 @@ def __init__(
self,
scope: Construct,
construct_id: str,
python_version: lambda_.Runtime = lambda_.Runtime.PYTHON_3_12,
python_version: lambda_.Runtime = lambda_.Runtime.PYTHON_3_13,
include_extras: bool = True,
architecture: lambda_.Architecture = lambda_.Architecture.X86_64,
powertools_version: str = "",
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@
from layer_v3.layer_constructors.helpers import construct_build_args
from layer_v3.layer_constructors.layer_stack import LambdaPowertoolsLayerPythonV3

# Test suit


def test_with_no_configuration_constructor():

@@ -17,7 +19,7 @@ def test_with_no_configuration_constructor():

template.has_resource_properties("AWS::Lambda::LayerVersion", {"LicenseInfo": "MIT-0"})

template.has_resource_properties("AWS::Lambda::LayerVersion", {"CompatibleRuntimes": ["python3.12"]})
template.has_resource_properties("AWS::Lambda::LayerVersion", {"CompatibleRuntimes": ["python3.13"]})


@pytest.mark.parametrize(
@@ -28,6 +30,7 @@ def test_with_no_configuration_constructor():
lambda_.Runtime.PYTHON_3_10,
lambda_.Runtime.PYTHON_3_11,
lambda_.Runtime.PYTHON_3_12,
lambda_.Runtime.PYTHON_3_13,
],
)
def test_with_different_python_version_x86_64(python_version):
@@ -64,6 +67,7 @@ def test_with_different_python_version_x86_64(python_version):
lambda_.Runtime.PYTHON_3_10,
lambda_.Runtime.PYTHON_3_11,
lambda_.Runtime.PYTHON_3_12,
lambda_.Runtime.PYTHON_3_13,
],
)
def test_with_different_python_version_arm64(python_version):
@@ -104,7 +108,7 @@ def test_with_custom_name():
template.has_resource_properties(
"AWS::Lambda::LayerVersion",
{
"Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.12] with extra dependencies latest version", # noqa E501
"Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.13] with extra dependencies latest version", # noqa E501
},
)

@@ -127,7 +131,7 @@ def test_with_extras():
template.has_resource_properties(
"AWS::Lambda::LayerVersion",
{
"Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.12] with extra dependencies version 3.0.0", # noqa E501
"Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.13] with extra dependencies version 3.0.0", # noqa E501
},
)

@@ -151,7 +155,7 @@ def test_with_extras_arm64():
template.has_resource_properties(
"AWS::Lambda::LayerVersion",
{
"Description": "Powertools for AWS Lambda (Python) V3 [arm64 - Python 3.12] with extra dependencies version 3.0.0", # noqa E501
"Description": "Powertools for AWS Lambda (Python) V3 [arm64 - Python 3.13] with extra dependencies version 3.0.0", # noqa E501
},
)

103 changes: 52 additions & 51 deletions layer_v3/poetry.lock
2 changes: 1 addition & 1 deletion layer_v3/pyproject.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ authors = ["Powertools for AWS Maintainers <aws-powertools-maintainers@amazon.co
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
aws-cdk-lib = "^2.161.0"
aws-cdk-lib = "^2.167.0"

[tool.poetry.dev-dependencies]
pytest = "^7.1.2"
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ warn_return_any=False
warn_unused_configs=True
no_implicit_optional=True
warn_redundant_casts=True
warn_unused_ignores=True
warn_unused_ignores=False
show_column_numbers = True
show_error_codes = True
show_error_context = True
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ def test_with_datadog_as_required_package(session: nox.Session):
folders=[
f"{PREFIX_TESTS_FUNCTIONAL}/metrics/datadog/",
],
extras="datadog",
)


733 changes: 376 additions & 357 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
repository = "https://github.com/aws-powertools/powertools-lambda-python"
documentation = "https://docs.powertools.aws.dev/lambda/python/"
@@ -71,11 +72,11 @@ xenon = "^0.9.3"
mkdocs-git-revision-date-plugin = "^0.3.2"
mike = "^2.1.2"
pytest-xdist = "^3.6.1"
aws-cdk-lib = "^2.166.0"
aws-cdk-lib = "^2.167.0"
"aws-cdk.aws-apigatewayv2-alpha" = "^2.38.1-alpha.0"
"aws-cdk.aws-apigatewayv2-integrations-alpha" = "^2.38.1-alpha.0"
"aws-cdk.aws-apigatewayv2-authorizers-alpha" = "^2.38.1-alpha.0"
"aws-cdk.aws-lambda-python-alpha" = "^2.166.0a0"
"aws-cdk.aws-lambda-python-alpha" = "^2.167.0a0"
"cdklabs.generative-ai-cdk-constructs" = "^0.1.281"
pytest-benchmark = "^4.0.0"
types-requests = "^2.31.0"
@@ -88,7 +89,6 @@ ijson = "^3.3.0"
typed-ast = { version = "^1.5.5", python = "< 3.8" }
hvac = "^2.3.0"
aws-requests-auth = "^0.4.3"
datadog-lambda = "^6.101.0"

[tool.poetry.extras]
parser = ["pydantic"]
10 changes: 6 additions & 4 deletions tests/e2e/utils/infrastructure.py
Original file line number Diff line number Diff line change
@@ -96,12 +96,12 @@ def create_lambda_functions(
self.create_lambda_functions()
```
Creating Lambda functions and override runtime to Python 3.12
Creating Lambda functions and override runtime to Python 3.13
```python
from aws_cdk.aws_lambda import Runtime
self.create_lambda_functions(function_props={"runtime": Runtime.PYTHON_3_12)
self.create_lambda_functions(function_props={"runtime": Runtime.PYTHON_3_13)
```
"""
if not self._handlers_dir.exists():
@@ -113,12 +113,12 @@ def create_lambda_functions(
"aws-lambda-powertools-e2e-test",
layer_version_name="aws-lambda-powertools-e2e-test",
compatible_runtimes=[
Runtime.PYTHON_3_7,
Runtime.PYTHON_3_8,
Runtime.PYTHON_3_9,
Runtime.PYTHON_3_10,
Runtime.PYTHON_3_11,
Runtime.PYTHON_3_12,
Runtime.PYTHON_3_13,
],
compatible_architectures=[architecture],
code=Code.from_asset(path=layer_build),
@@ -260,8 +260,10 @@ def _determine_runtime_version(self) -> Runtime:
return Runtime.PYTHON_3_11
elif version.major == 3 and version.minor == 12:
return Runtime.PYTHON_3_12
elif version.major == 3 and version.minor == 13:
return Runtime.PYTHON_3_13
else:
raise Exception(f"Unsupported Python version: {version}")
raise ValueError(f"Unsupported Python version: {version}")

def create_resources(self) -> None:
"""Create any necessary CDK resources. It'll be called before deploy