Skip to content

Commit 3ae7c58

Browse files
authored
fix(docs): keep China layer versions aligned (#8438)
Stage the installation page in release documentation updates and constrain ARN replacements by partition. This keeps China aligned without advancing GovCloud or implying continued Python 3.9 releases. Fixes GH-8437
1 parent 75444cb commit 3ae7c58

4 files changed

Lines changed: 18 additions & 21 deletions

File tree

‎.github/workflows/publish_v3_layer.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ jobs:
284284
id: create-pr
285285
uses: ./.github/actions/create-pr
286286
with:
287-
files: "docs/index.md docs/includes/_layer_homepage_arm64.md docs/includes/_layer_homepage_x86.md examples CHANGELOG.md"
287+
files: "docs/index.md docs/getting-started/install.md docs/includes/_layer_homepage_arm64.md docs/includes/_layer_homepage_x86.md examples CHANGELOG.md"
288288
temp_branch_prefix: "ci-layer-docs"
289289
pull_request_title: "chore(ci): layer docs update"
290290
github_token: ${{ secrets.GITHUB_TOKEN }}

‎docs/getting-started/install.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ We publish `prerelease` versions to PyPi for early feedback on unstable releases
8484

8585
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that contains pre-packaged dependencies. We compile and optimize all dependencies for both x86_64 and ARM architectures.
8686

87-
Replace `{region}` with your AWS region (e.g., `eu-west-1`) and `{python_version}` without the period (e.g., `python313` for Python 3.13).
87+
Replace `{region}` with your AWS region (e.g., `eu-west-1`) and `{python_version}` with a currently supported runtime: `python310`, `python311`, `python312`, `python313`, or `python314`. Python 3.9 layers stopped at layer version 27.
8888

8989
| Architecture | Layer ARN |
9090
| ------------ | --------- |
91-
| x86_64 | `arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:27` |
92-
| ARM64 | `arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:27` |
91+
| x86_64 | `arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:37` |
92+
| ARM64 | `arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:37` |
9393

9494
### All regional Layer ARNs
9595

@@ -101,7 +101,7 @@ Replace `{region}` with your AWS region (e.g., `eu-west-1`) and `{python_version
101101

102102
??? tip "Want to inspect the Layer contents?"
103103
```bash
104-
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:27 --region eu-west-1
104+
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python313-x86_64:37 --region eu-west-1
105105
```
106106
The pre-signed URL will be in the `Location` key.
107107

@@ -167,8 +167,8 @@ We publish Layer ARNs to SSM Parameter Store for easier automation:
167167

168168
| Region | Architecture | Layer ARN |
169169
| ------ | ------------ | --------- |
170-
| cn-north-1 | x86_64 | `arn:aws-cn:lambda:cn-north-1:498634801083:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:27` |
171-
| cn-north-1 | ARM64 | `arn:aws-cn:lambda:cn-north-1:498634801083:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:27` |
170+
| cn-north-1 | x86_64 | `arn:aws-cn:lambda:cn-north-1:498634801083:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86_64:37` |
171+
| cn-north-1 | ARM64 | `arn:aws-cn:lambda:cn-north-1:498634801083:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:37` |
172172

173173
### AWS GovCloud regions
174174

‎docs/maintainers.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ Releasing a new version is a multi-step process that takes up to 2 hours to comp
170170
1. **Run [end-to-end tests](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/run-e2e-tests.yml)** and ensure they pass
171171
2. **Trigger Release v3 workflow** - Run the [`Release v3`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/release-v3.yml) workflow with two inputs: the new Powertools version (check [latest version](https://pypi.org/project/aws-lambda-powertools/)) and the new Lambda Layer version number. To find the new Lambda Layer version number, go to this [page](https://docs.powertools.aws.dev/lambda/python/latest/#python-313) and increase the version by one (N + 1).
172172
3. **Monitor the release workflow** - it runs tests, publishes to PyPI, deploys Lambda layers to Beta and Prod environments across all commercial regions, runs canary tests, and updates documentation. If it fails, see the [Re-run partial failed Release workflow](#re-run-partial-failed-release-workflow) section
173-
4. **Review and merge documentation/version PRs** - two PRs will be created to update documentation and bump version files. Review, approve and merge both (order doesn't matter)
174-
5. **Deploy GovCloud layers** - Run the [`Layer Deployment (GovCloud)`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/layer_govcloud.yml) workflow with `develop` branch, `Prod` environment, and the Layer version number from step 2.
175-
6. **Deploy China layers** - Run the [`Layer Deployment (Partitions)`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/layers_partitions.yml) workflow with `develop` branch, `Prod` environment, and the Layer version number from step 2.
173+
4. **Deploy GovCloud layers** - Run the [`Layer Deployment (GovCloud)`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/layer_govcloud.yml) workflow with `develop` branch, `Prod` environment, and the Layer version number from step 2.
174+
5. **Deploy China layers** - Run the [`Layer Balancer (Partitions)`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/layers_partition_balance.yml) workflow for each supported Python runtime with the `develop` branch, `Prod` environment, `China` partition, both architectures, and the Layer version number from step 2. Run it first as a dry run, then publish after it succeeds.
175+
6. **Review and merge documentation/version PRs** - two PRs will be created to update documentation and bump version files. Review, approve and merge both after the partition deployments succeed (order doesn't matter).
176176
7. **Update documentation** - Run the [`Rebuild latest docs`](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/rebuild_latest_docs.yml) workflow with `develop` branch and the PyPI package version
177177

178178
Once complete, you can start drafting the release notes to let customers know **what changed and what's in it for them (a.k.a why they should care)**. We have guidelines in the [release notes](#drafting-release-notes) section so you know what good looks like.

‎layer_v3/scripts/update_layer_arn_v3.sh‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# This script is run during the publish_v3_layer.yml CI job,
44
# and it is responsible for replacing the layer ARN in our documentation.
5-
# Our pipeline must generate the same layer number for all commercial regions + gov cloud
6-
# If this doesn't happens, we have an error and we must fix it in the deployment.
5+
# Our pipeline must generate the same layer number for all commercial regions.
6+
# China mirrors that version, and its documentation PR is merged after deployment.
7+
# GovCloud layer versions are updated independently.
78
#
89
# see .github/workflows/reusable_deploy_v3_layer_stack.yml
910

@@ -29,16 +30,12 @@ find ./docs ./examples -type f \( -name "*.md" -o -name "*.py" -o -name "*.yaml"
2930
# The regex matches the layer name and replaces only the version number at the end
3031

3132
# Commercial AWS (arn:aws:lambda)
32-
sed -i -E "s/(AWSLambdaPowertoolsPythonV3-python[0-9]+-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
33-
sed -i -E "s/(AWSLambdaPowertoolsPythonV3-{python_version}-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
34-
33+
sed -i -E "s/(arn:aws:lambda:[^[:space:]]*:layer:AWSLambdaPowertoolsPythonV3-python[0-9]+-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
34+
sed -i -E "s/(arn:aws:lambda:[^[:space:]]*:layer:AWSLambdaPowertoolsPythonV3-{python_version}-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
35+
3536
# AWS China (arn:aws-cn:lambda)
36-
sed -i -E "s/(arn:aws-cn:lambda:[^:]+:[^:]+:layer:AWSLambdaPowertoolsPythonV3-python[0-9]+-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
37-
sed -i -E "s/(arn:aws-cn:lambda:[^:]+:[^:]+:layer:AWSLambdaPowertoolsPythonV3-{python_version}-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
38-
39-
# AWS GovCloud (arn:aws-us-gov:lambda)
40-
sed -i -E "s/(arn:aws-us-gov:lambda:[^:]+:[^:]+:layer:AWSLambdaPowertoolsPythonV3-python[0-9]+-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
41-
sed -i -E "s/(arn:aws-us-gov:lambda:[^:]+:[^:]+:layer:AWSLambdaPowertoolsPythonV3-{python_version}-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
37+
sed -i -E "s/(arn:aws-cn:lambda:[^[:space:]]*:layer:AWSLambdaPowertoolsPythonV3-python[0-9]+-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
38+
sed -i -E "s/(arn:aws-cn:lambda:[^[:space:]]*:layer:AWSLambdaPowertoolsPythonV3-{python_version}-((arm64)|(x86_64)):)[0-9]+/\1$new_version/g" "$file"
4239

4340
if [ $? -eq 0 ]; then
4441
echo "Updated $file successfully"

0 commit comments

Comments
 (0)