Skip to content

Commit f9a8c5b

Browse files
committed
docs: add Lambda Layer SAR App url and ARN
Signed-off-by: heitorlessa <[email protected]>
1 parent 50ad7de commit f9a8c5b

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

docs/content/index.mdx

+20-16
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,30 @@ Powertools is available in PyPi. You can use your favourite dependency managemen
2020
* [pip](https://pip.pypa.io/en/latest/index.html): `pip install aws-lambda-powertools`
2121

2222
**Quick hello world example using SAM CLI**
23+
2324
```bash:title=hello_world.sh
2425
sam init --location https://github.com/aws-samples/cookiecutter-aws-sam-python
2526
```
2627

28+
### Lambda Layer
29+
30+
Powertools is also available as a Lambda Layer. It is distributed via the [AWS Serverless Application Repository (SAR)](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html).
31+
32+
App | ARN
33+
----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------
34+
[aws-lambda-powertools-python-layer](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer) | arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer
35+
36+
If using SAM, you can include this SAR App as part of your shared Layers stack, and lock to a specific semantic version. Once deployed, it'll be available across the account this is deployed to.
37+
38+
```yaml
39+
AwsLambdaPowertoolsPythonLayer:
40+
Type: AWS::Serverless::Application
41+
Properties:
42+
Location:
43+
ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer
44+
SemanticVersion: 1.3.1 # change to latest semantic version available in SAR
45+
```
46+
2747
## Features
2848
2949
Utility | Description
@@ -58,22 +78,6 @@ from aws_lambda_powertools.logging.logger import set_package_logger
5878
set_package_logger()
5979
```
6080

61-
## Lambda Layer
62-
63-
Powertools is also available as a layer and is distributed via the [Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html).
64-
Create the layer via API with:
65-
66-
```bash:title=bash-script
67-
aws serverlessrepo create-cloud-formation-change-set --application-id arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer --stack-name YOUR_STACK_NAME --capabilities CAPABILITY_NAMED_IAM
68-
CHANGE_SET_ID=$(aws cloudformation list-change-sets --stack-name YOUR_STACK_NAME --query 'Summaries[*].ChangeSetId' --output text)
69-
aws cloudformation wait change-set-create-complete --change-set-name $CHANGE_SET_ID
70-
aws cloudformation execute-change-set --change-set-name $CHANGE_SET_ID
71-
```
72-
73-
this will create a CloudFormation stack with the powertools layer in a specific region where you run this commands.
74-
Keep in mind that layers are regional resources and you need to create the layer in every region where you need it.
75-
Alternatively, you can deploy the layer from the AWS Console by navigating to Serverless Application Repository and search for `aws-lambda-powertools-python-layer` and follow the deploy steps from there.
76-
7781
## Tenets
7882

7983
* **AWS Lambda only** – We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported.

0 commit comments

Comments
 (0)