diff --git a/docs/index.md b/docs/index.md index 36faede7e96..228f8510c09 100644 --- a/docs/index.md +++ b/docs/index.md @@ -67,10 +67,10 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc 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 | - | ------------ | --------------------------------------------------------------------------------------------------------- | - | x86_64 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:7__{: .copyMe}:clipboard: | - | ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:7__{: .copyMe}:clipboard: | + | Architecture | Layer ARN | + | ------------ | ----------------------------------------------------------------------------------------------------------------------------- | + | x86_64 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:7__{: .copyMe}:clipboard: | + | ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:7__{: .copyMe}:clipboard: | === "AWS Console" @@ -234,12 +234,12 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc We provide a SAR App that deploys a CloudFormation stack with a copy of our Lambda Layer in your AWS account and region. - Compared with the [public Layer ARN](#lambda-layer) option, the advantage is being able to use a semantic version. + Compared with the [public Layer ARN](#lambda-layer) option, the advantage is being able to use a semantic version. Make sure to replace `{python_version}` without the period (.), e.g., `python313` for `Python 3.13`. - | App | | | ARN | - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | ----------------------------------------------------------------------------------------------------------------------------- | - | [**aws-lambda-powertools-python-layer**](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer){target="_blank"} | | | __arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer__{: .copyMe}:clipboard: | - | [**aws-lambda-powertools-python-layer-arm64**](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-arm64){target="_blank"} | | | __arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-arm64__{: .copyMe}:clipboard: | + | App | ARN | Architecture | + | --- | --- | ------------ | + | aws-lambda-powertools-python-layer-v3-{python_version}-x86-64 | arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-{python_version}-x86-64 | X86_64 | + | aws-lambda-powertools-python-layer-v3-{python_version}-arm64 | arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-{python_version}-arm64 | ARM64 | ??? question "Don't have enough permissions? Expand for a least-privilege IAM policy example" @@ -328,10 +328,18 @@ Serverless Application Repository (SAR) App deploys a CloudFormation stack with Compared with the [public Layer ARN](#lambda-layer) option, SAR allows you to choose a semantic version and deploys a Layer in your target account. -| App | ARN | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | -| [**aws-lambda-powertools-python-layer**](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer](#){: .copyMe}:clipboard: | Contains all extra dependencies (e.g: pydantic). | -| [**aws-lambda-powertools-python-layer-arm64**](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-arm64](#){: .copyMe}:clipboard: | Contains all extra dependencies (e.g: pydantic). For arm64 functions. | +| App | ARN | Python version | Architecture | +| --- | --- | -------------- | ------------ | +| [aws-lambda-powertools-python-layer-v3-python39-x86-64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python39-x86-64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python39-x86-64](#){: .copyMe}:clipboard: | Python 3.9 | X86_64 | +| [aws-lambda-powertools-python-layer-v3-python310-x86-64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python310-x86-64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python310-x86-64](#){: .copyMe}:clipboard: | Python 3.10 | X86_64 | +| [aws-lambda-powertools-python-layer-v3-python311-x86-64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python11-x86-64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python311-x86-64](#){: .copyMe}:clipboard: | Python 3.11 | X86_64 | +| [aws-lambda-powertools-python-layer-v3-python312-x86-64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python12-x86-64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python312-x86-64](#){: .copyMe}:clipboard: | Python 3.12 | X86_64 | +| [aws-lambda-powertools-python-layer-v3-python313-x86-64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python313-x86-64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64](#){: .copyMe}:clipboard: | Python 3.13 | X86_64 | +| [aws-lambda-powertools-python-layer-v3-python39-arm64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python39-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python39-arm64](#){: .copyMe}:clipboard: | Python 3.9 | ARM64 | +| [aws-lambda-powertools-python-layer-v3-python310-arm64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python310-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python310-arm64](#){: .copyMe}:clipboard: | Python 3.10 | ARM64 | +| [aws-lambda-powertools-python-layer-v3-python311-arm64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python11-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python311-arm64](#){: .copyMe}:clipboard: | Python 3.11 | ARM64 | +| [aws-lambda-powertools-python-layer-v3-python312-arm64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python12-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python312-arm64](#){: .copyMe}:clipboard: | Python 3.12 | ARM64 | +| [aws-lambda-powertools-python-layer-v3-python313-arm64](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer-v3-python313-arm64){target="_blank"} | [arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-arm64](#){: .copyMe}:clipboard: | Python 3.13 | ARM64 | ??? note "Click to expand and copy SAR code snippets for popular frameworks" @@ -351,7 +359,7 @@ Compared with the [public Layer ARN](#lambda-layer) option, SAR allows you to ch === "CDK" - ```python hl_lines="7 16-20 23-27" + ```python hl_lines="8 16-20 23-27" --8<-- "examples/homepage/install/sar/cdk_sar.py" ``` diff --git a/examples/homepage/install/sar/cdk_sar.py b/examples/homepage/install/sar/cdk_sar.py index de0d9c22dd8..1d07f4a7098 100644 --- a/examples/homepage/install/sar/cdk_sar.py +++ b/examples/homepage/install/sar/cdk_sar.py @@ -3,9 +3,9 @@ POWERTOOLS_BASE_NAME = "AWSLambdaPowertools" # Find latest from github.com/aws-powertools/powertools-lambda-python/releases -POWERTOOLS_VER = "2.43.1" +POWERTOOLS_VER = "3.0.9" POWERTOOLS_ARN = ( - "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer" + "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64" ) @@ -31,7 +31,7 @@ def __init__(self, scope: Construct, id_: str) -> None: aws_lambda.Function( self, "sample-app-lambda", - runtime=aws_lambda.Runtime.PYTHON_3_12, + runtime=aws_lambda.Runtime.PYTHON_3_13, function_name="sample-lambda", code=aws_lambda.Code.from_asset("lambda"), handler="hello.handler", diff --git a/examples/homepage/install/sar/sam.yaml b/examples/homepage/install/sar/sam.yaml index 3200554a190..189c807e1d9 100644 --- a/examples/homepage/install/sar/sam.yaml +++ b/examples/homepage/install/sar/sam.yaml @@ -6,13 +6,13 @@ Resources: Type: AWS::Serverless::Application Properties: Location: - ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer - SemanticVersion: 2.43.1 # change to latest semantic version available in SAR + ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64 + SemanticVersion: 3.0.9 # change to latest semantic version available in SAR MyLambdaFunction: Type: AWS::Serverless::Function Properties: - Runtime: python3.12 + Runtime: python3.13 Handler: app.lambda_handler Layers: # fetch Layer ARN from SAR App stack output diff --git a/examples/homepage/install/sar/scoped_down_iam.yaml b/examples/homepage/install/sar/scoped_down_iam.yaml index d639cde72c4..57c9ae317e7 100644 --- a/examples/homepage/install/sar/scoped_down_iam.yaml +++ b/examples/homepage/install/sar/scoped_down_iam.yaml @@ -33,7 +33,7 @@ - serverlessrepo:GetCloudFormationTemplate Resource: # this is arn of the Powertools for AWS Lambda (Python) SAR app - - arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python312-x86_64 + - arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64 - Sid: S3AccessLayer Effect: Allow Action: @@ -42,7 +42,7 @@ # AWS publishes to an external S3 bucket locked down to your account ID # The below example is us publishing Powertools for AWS Lambda (Python) # Bucket: awsserverlessrepo-changesets-plntc6bfnfj - # Key: *****/arn:aws:serverlessrepo:eu-west-1:057560766410:applications-aws-lambda-powertools-python-layer-versions-1.10.2/aeeccf50-****-****-****-********* + # Key: *****/arn:aws:serverlessrepo:eu-west-1:057560766410:applications-aws-lambda-powertools-python-layer-v3-python313-x86-64-3.0.9/aeeccf50-****-****-****-********* - arn:aws:s3:::awsserverlessrepo-changesets-*/* - Sid: GetLayerVersion Effect: Allow @@ -50,6 +50,6 @@ - lambda:PublishLayerVersion - lambda:GetLayerVersion Resource: - - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:aws-lambda-powertools-python-layer* + - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:aws-lambda-powertools-python-layer-v3* Roles: - Ref: "PowertoolsLayerIamRole" diff --git a/examples/homepage/install/sar/serverless.yml b/examples/homepage/install/sar/serverless.yml index de7308915cc..e37c292d2b0 100644 --- a/examples/homepage/install/sar/serverless.yml +++ b/examples/homepage/install/sar/serverless.yml @@ -2,7 +2,7 @@ service: powertools-lambda provider: name: aws - runtime: python3.12 + runtime: python3.13 region: us-east-1 functions: @@ -16,5 +16,5 @@ resources: Type: AWS::Serverless::Application Properties: Location: - ApplicationId: arn:aws:serverlessrepo:us-east-1:057560766410:applications/aws-lambda-powertools-python-layer - SemanticVersion: 2.43.1 + ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64 + SemanticVersion: 3.0.9 diff --git a/examples/homepage/install/sar/terraform.tf b/examples/homepage/install/sar/terraform.tf index cfca2eda9d0..35d615ccf07 100644 --- a/examples/homepage/install/sar/terraform.tf +++ b/examples/homepage/install/sar/terraform.tf @@ -21,13 +21,13 @@ resource "aws_serverlessapplicationrepository_cloudformation_stack" "deploy_sar_ } data "aws_serverlessapplicationrepository_application" "sar_app" { - application_id = "arn:aws:serverlessrepo:us-east-1:057560766410:applications/aws-lambda-powertools-python-layer" + application_id = "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64" semantic_version = var.aws_powertools_version } variable "aws_powertools_version" { type = string - default = "2.43.1" + default = "3.0.9" description = "The Powertools for AWS Lambda (Python) release version" }