Skip to content

Commit 74af8a9

Browse files
committed
fix ssm placement
1 parent 7a1a355 commit 74af8a9

File tree

1 file changed

+51
-48
lines changed

1 file changed

+51
-48
lines changed

docs/index.md

+51-48
Original file line numberDiff line numberDiff line change
@@ -72,68 +72,51 @@ 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-
```
75+
=== "AWS Console"
9276

93-
**Terraform**
77+
You can add our layer using the [AWS Lambda Console _(direct link)_](https://console.aws.amazon.com/lambda/home#/add/layer){target="_blank"}:
9478

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.
79+
* Under Layers, choose `AWS layers` or `Specify an ARN`
80+
* Click to copy the [correct ARN](#lambda-layer) value based on your AWS Lambda function architecture and region
9681

97-
```
98-
data "aws_ssm_parameter" "powertools_version" {
99-
name = "/aws/service/powertools/python/{arch}/{python_version}/{version}"
100-
}
10182

102-
resource "aws_lambda_function" "test_lambda" {
103-
...
83+
=== "AWS SSM Parameter Store"
84+
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:
10485

105-
runtime = "python3.13"
86+
**CloudFormation**
10687

107-
layers = [data.aws_ssm_parameter.powertools_version.value]
108-
}
109-
```
88+
Sample Placeholders:
11089

111-
=== "Lambda Layer (GovCloud)"
90+
- `{arch}` is either `arm64` (Graviton based functions) or `x86_64`
91+
- `{python_version}` is the Python version without the period (.), e.g., `python313` for `Python 3.13`.
92+
- `{version}` is the semantic version number (e,g. 3.1.0) for a release or `latest`
11293

113-
[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.
94+
```yaml
95+
MyFunction:
96+
Type: "AWS::Lambda::Function"
97+
Properties:
98+
...
99+
Layers:
100+
- {{resolve:ssm:/aws/service/powertools/python/{arch}/{python_version}/{version}}}
101+
```
114102

115-
For the latter, make sure to replace `{python_version}` without the period (.), e.g., `python313` for `Python 3.13`.
103+
**Terraform**
116104

117-
**AWS GovCloud (us-gov-east-1)**
105+
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.
118106

119-
| Architecture | Layer ARN |
120-
| ------------ | --------------------------------------------------------------------------------------------------------- |
121-
| x86_64 | __arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:4__{: .copyMe}:clipboard: |
122-
| ARM | __arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:4__{: .copyMe}:clipboard: |
123-
124-
**AWS GovCloud (us-gov-west-1)**
125-
126-
| Architecture | Layer ARN |
127-
| ------------ | --------------------------------------------------------------------------------------------------------- |
128-
| x86_64 | __arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:4__{: .copyMe}:clipboard: |
129-
| ARM | __arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:4__{: .copyMe}:clipboard: |
107+
```hcl
108+
data "aws_ssm_parameter" "powertools_version" {
109+
name = "/aws/service/powertools/python/{arch}/{python_version}/{version}"
110+
}
130111

131-
=== "AWS Console"
112+
resource "aws_lambda_function" "test_lambda" {
113+
...
132114

133-
You can add our layer using the [AWS Lambda Console _(direct link)_](https://console.aws.amazon.com/lambda/home#/add/layer){target="_blank"}:
115+
runtime = "python3.13"
134116

135-
* Under Layers, choose `AWS layers` or `Specify an ARN`
136-
* Click to copy the [correct ARN](#lambda-layer) value based on your AWS Lambda function architecture and region
117+
layers = [data.aws_ssm_parameter.powertools_version.value]
118+
}
119+
```
137120

138121
=== "Infrastructure as Code (IaC)"
139122

@@ -227,6 +210,26 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc
227210

228211
You'll find the pre-signed URL under `Location` key as part of the CLI command output.
229212

213+
=== "Lambda Layer (GovCloud)"
214+
215+
[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.
216+
217+
For the latter, make sure to replace `{python_version}` without the period (.), e.g., `python313` for `Python 3.13`.
218+
219+
**AWS GovCloud (us-gov-east-1)**
220+
221+
| Architecture | Layer ARN |
222+
| ------------ | --------------------------------------------------------------------------------------------------------- |
223+
| x86_64 | __arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:4__{: .copyMe}:clipboard: |
224+
| ARM | __arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:4__{: .copyMe}:clipboard: |
225+
226+
**AWS GovCloud (us-gov-west-1)**
227+
228+
| Architecture | Layer ARN |
229+
| ------------ | --------------------------------------------------------------------------------------------------------- |
230+
| x86_64 | __arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:4__{: .copyMe}:clipboard: |
231+
| ARM | __arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:4__{: .copyMe}:clipboard: |
232+
230233
=== "Serverless Application Repository (SAR)"
231234

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

0 commit comments

Comments
 (0)