Skip to content

Commit a49f9c6

Browse files
docs(homepage): add SAR documentation (#6347)
Adding SAR documentation
1 parent 75e2270 commit a49f9c6

File tree

6 files changed

+36
-28
lines changed

6 files changed

+36
-28
lines changed

docs/index.md

+22-14
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc
6767

6868
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`.
6969

70-
| Architecture | Layer ARN |
71-
| ------------ | --------------------------------------------------------------------------------------------------------- |
72-
| x86_64 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:7__{: .copyMe}:clipboard: |
73-
| ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:7__{: .copyMe}:clipboard: |
70+
| Architecture | Layer ARN |
71+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
72+
| x86_64 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:7__{: .copyMe}:clipboard: |
73+
| ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:7__{: .copyMe}:clipboard: |
7474

7575
=== "AWS Console"
7676

@@ -234,12 +234,12 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc
234234

235235
We provide a SAR App that deploys a CloudFormation stack with a copy of our Lambda Layer in your AWS account and region.
236236

237-
Compared with the [public Layer ARN](#lambda-layer) option, the advantage is being able to use a semantic version.
237+
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`.
238238

239-
| App | | | ARN |
240-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | ----------------------------------------------------------------------------------------------------------------------------- |
241-
| [**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: |
242-
| [**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: |
239+
| App | ARN | Architecture |
240+
| --- | --- | ------------ |
241+
| 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 |
242+
| 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 |
243243

244244
??? question "Don't have enough permissions? Expand for a least-privilege IAM policy example"
245245

@@ -328,10 +328,18 @@ Serverless Application Repository (SAR) App deploys a CloudFormation stack with
328328

329329
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.
330330

331-
| App | ARN | Description |
332-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
333-
| [**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). |
334-
| [**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. |
331+
| App | ARN | Python version | Architecture |
332+
| --- | --- | -------------- | ------------ |
333+
| [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 |
334+
| [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 |
335+
| [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 |
336+
| [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 |
337+
| [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 |
338+
| [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 |
339+
| [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 |
340+
| [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 |
341+
| [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 |
342+
| [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 |
335343

336344
??? note "Click to expand and copy SAR code snippets for popular frameworks"
337345

@@ -351,7 +359,7 @@ Compared with the [public Layer ARN](#lambda-layer) option, SAR allows you to ch
351359

352360
=== "CDK"
353361

354-
```python hl_lines="7 16-20 23-27"
362+
```python hl_lines="8 16-20 23-27"
355363
--8<-- "examples/homepage/install/sar/cdk_sar.py"
356364
```
357365

examples/homepage/install/sar/cdk_sar.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
POWERTOOLS_BASE_NAME = "AWSLambdaPowertools"
55
# Find latest from github.com/aws-powertools/powertools-lambda-python/releases
6-
POWERTOOLS_VER = "2.43.1"
6+
POWERTOOLS_VER = "3.0.9"
77
POWERTOOLS_ARN = (
8-
"arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer"
8+
"arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64"
99
)
1010

1111

@@ -31,7 +31,7 @@ def __init__(self, scope: Construct, id_: str) -> None:
3131
aws_lambda.Function(
3232
self,
3333
"sample-app-lambda",
34-
runtime=aws_lambda.Runtime.PYTHON_3_12,
34+
runtime=aws_lambda.Runtime.PYTHON_3_13,
3535
function_name="sample-lambda",
3636
code=aws_lambda.Code.from_asset("lambda"),
3737
handler="hello.handler",

examples/homepage/install/sar/sam.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Resources:
66
Type: AWS::Serverless::Application
77
Properties:
88
Location:
9-
ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer
10-
SemanticVersion: 2.43.1 # change to latest semantic version available in SAR
9+
ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64
10+
SemanticVersion: 3.0.9 # change to latest semantic version available in SAR
1111

1212
MyLambdaFunction:
1313
Type: AWS::Serverless::Function
1414
Properties:
15-
Runtime: python3.12
15+
Runtime: python3.13
1616
Handler: app.lambda_handler
1717
Layers:
1818
# fetch Layer ARN from SAR App stack output

examples/homepage/install/sar/scoped_down_iam.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- serverlessrepo:GetCloudFormationTemplate
3434
Resource:
3535
# this is arn of the Powertools for AWS Lambda (Python) SAR app
36-
- arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python312-x86_64
36+
- arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64
3737
- Sid: S3AccessLayer
3838
Effect: Allow
3939
Action:
@@ -42,14 +42,14 @@
4242
# AWS publishes to an external S3 bucket locked down to your account ID
4343
# The below example is us publishing Powertools for AWS Lambda (Python)
4444
# Bucket: awsserverlessrepo-changesets-plntc6bfnfj
45-
# Key: *****/arn:aws:serverlessrepo:eu-west-1:057560766410:applications-aws-lambda-powertools-python-layer-versions-1.10.2/aeeccf50-****-****-****-*********
45+
# Key: *****/arn:aws:serverlessrepo:eu-west-1:057560766410:applications-aws-lambda-powertools-python-layer-v3-python313-x86-64-3.0.9/aeeccf50-****-****-****-*********
4646
- arn:aws:s3:::awsserverlessrepo-changesets-*/*
4747
- Sid: GetLayerVersion
4848
Effect: Allow
4949
Action:
5050
- lambda:PublishLayerVersion
5151
- lambda:GetLayerVersion
5252
Resource:
53-
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:aws-lambda-powertools-python-layer*
53+
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:aws-lambda-powertools-python-layer-v3*
5454
Roles:
5555
- Ref: "PowertoolsLayerIamRole"

examples/homepage/install/sar/serverless.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ service: powertools-lambda
22

33
provider:
44
name: aws
5-
runtime: python3.12
5+
runtime: python3.13
66
region: us-east-1
77

88
functions:
@@ -16,5 +16,5 @@ resources:
1616
Type: AWS::Serverless::Application
1717
Properties:
1818
Location:
19-
ApplicationId: arn:aws:serverlessrepo:us-east-1:057560766410:applications/aws-lambda-powertools-python-layer
20-
SemanticVersion: 2.43.1
19+
ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64
20+
SemanticVersion: 3.0.9

examples/homepage/install/sar/terraform.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ resource "aws_serverlessapplicationrepository_cloudformation_stack" "deploy_sar_
2121
}
2222

2323
data "aws_serverlessapplicationrepository_application" "sar_app" {
24-
application_id = "arn:aws:serverlessrepo:us-east-1:057560766410:applications/aws-lambda-powertools-python-layer"
24+
application_id = "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-v3-python313-x86-64"
2525
semantic_version = var.aws_powertools_version
2626
}
2727

2828
variable "aws_powertools_version" {
2929
type = string
30-
default = "2.43.1"
30+
default = "3.0.9"
3131
description = "The Powertools for AWS Lambda (Python) release version"
3232
}
3333

0 commit comments

Comments
 (0)