From 912098bf7a1990ad2f3ae43710f487758a0f7627 Mon Sep 17 00:00:00 2001 From: Leo Hanisch Date: Thu, 21 Sep 2023 10:47:51 +0200 Subject: [PATCH 1/3] fix: typo for serverless framework According to the docs it should be {aws:region} --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 55c581ee7d..9c7103c4b5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -108,7 +108,7 @@ You can include Powertools for AWS Lambda (TypeScript) Lambda Layer using [AWS L hello: handler: lambda_function.lambda_handler layers: - - arn:aws:lambda:${aws::region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:19 + - arn:aws:lambda:${aws:region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:19 ``` If you use `esbuild` to bundle your code, make sure to exclude `@aws-lambda-powertools` from being bundled since the packages will be already present the Layer: From b9a07d0d4bec39207745b296604249aec907fc77 Mon Sep 17 00:00:00 2001 From: Leo Hanisch Date: Thu, 21 Sep 2023 12:55:26 +0200 Subject: [PATCH 2/3] fix: use correct serverless framework variable syntax --- .github/scripts/update_layer_arn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/update_layer_arn.sh b/.github/scripts/update_layer_arn.sh index 51a7149880..3664259812 100755 --- a/.github/scripts/update_layer_arn.sh +++ b/.github/scripts/update_layer_arn.sh @@ -56,7 +56,7 @@ for file in $files; do # arn:aws:lambda:{env.region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:39 if [[ "$line" == *"eu-central-1"* ]]; then # These are all the framework pseudo parameters currently found in the docs - for pseudo_region in '{region}' '${AWS::Region}' '${aws::region}' '{aws::region}' '{env.region}' '${cdk.Stack.of(this).region}' '${aws.getRegionOutput().name}'; do + for pseudo_region in '{region}' '${AWS::Region}' '${aws:region}' '{aws::region}' '{env.region}' '${cdk.Stack.of(this).region}' '${aws.getRegionOutput().name}'; do prefix_pseudo_region=$(echo "$prefix" | sed "s/eu-central-1/${pseudo_region}/") # prefix_pseudo_region = arn:aws:lambda:${AWS::Region}:094274105915:layer:AWSLambdaPowertoolsTypeScript From f1b85e8ab2388a27b9f341cf881936c53d1fabd8 Mon Sep 17 00:00:00 2001 From: Leo Hanisch Date: Thu, 21 Sep 2023 13:26:16 +0200 Subject: [PATCH 3/3] fix: use latest layer version in docs --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 7ff062543f..0e569aa4fe 100644 --- a/docs/index.md +++ b/docs/index.md @@ -108,7 +108,7 @@ You can include Powertools for AWS Lambda (TypeScript) Lambda Layer using [AWS L hello: handler: lambda_function.lambda_handler layers: - - arn:aws:lambda:${aws:region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:19 + - arn:aws:lambda:${aws:region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:20 ``` If you use `esbuild` to bundle your code, make sure to exclude `@aws-lambda-powertools` from being bundled since the packages will be already present the Layer: