Skip to content

Commit 7a1a355

Browse files
committed
add docs
1 parent 9cbed4b commit 7a1a355

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,42 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc
7272
| x86_64 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:4__{: .copyMe}:clipboard: |
7373
| ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:4__{: .copyMe}:clipboard: |
7474

75+
We offer Parameter Store aliases for releases too, allowing you to specify either specific versions or use the latest version on every deploy. To use these you can add these snippets to your AWS CloudFormation or Terraform projects:
76+
77+
**CloudFormation**
78+
79+
Sample Placeholders:
80+
- `{arch}` is either `arm64` (Graviton based functions) or `x86_64`
81+
- `{python_version}` is the Python version without the period (.), e.g., `python313` for `Python 3.13`.
82+
- `{version}` is the semantic version number (e,g. 3.1.0) for a release or `latest`
83+
84+
```
85+
MyFunction:
86+
Type: "AWS::Lambda::Function"
87+
Properties:
88+
...
89+
Layers:
90+
- {{resolve:ssm:/aws/service/powertools/python/{arch}/{python_version}/{version}}}
91+
```
92+
93+
**Terraform**
94+
95+
Using the [`aws_ssm_parameter`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) data provider from the AWS Terraform provider allows you to lookup the value of parameters to use later in your project.
96+
97+
```
98+
data "aws_ssm_parameter" "powertools_version" {
99+
name = "/aws/service/powertools/python/{arch}/{python_version}/{version}"
100+
}
101+
102+
resource "aws_lambda_function" "test_lambda" {
103+
...
104+
105+
runtime = "python3.13"
106+
107+
layers = [data.aws_ssm_parameter.powertools_version.value]
108+
}
109+
```
110+
75111
=== "Lambda Layer (GovCloud)"
76112

77113
[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.

0 commit comments

Comments
 (0)