-
When I started working with Powertools in January this year, I copied a layer ARN from the documentation homepage.
The last part of the ARN means it was layer version 7. Today the documentation shows this ARN:
The last part of the ARN means layer version 12. How do I correspond the layer version to the semantic version of the library? The semantic versions look like this: 3.8.0, 3.9.0, 3.10.0. I see another discussion from 2023 where it seems a maintainer decided against documenting the content of the layer in favor of allowing a user to "peek into the contents" of the layer. I hope this isn't the only way, because it not at all clear whether it will help me answer my question. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I scripted the Lambda Layers API to find the solution.
To reproduce, run this code in Bash. get-powertools-version-for-layer-version() {
layer="arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPythonV3-python312-arm64"
version="$1"
aws lambda get-layer-version-by-arn --arn "$layer:$version" |
jq -c '{
LayerVersion: .Version | tostring,
LayerVersionCreatedDate: .CreatedDate[0:10],
PowertoolsVersion: .Description | split(" ") | .[-1]
}'
}
export -f get-powertools-version-for-layer-version
seq 1 12 | parallel -k get-powertools-version-for-layer-version | jtbl -m As well as the AWS CLI, you'll need more tools: jq, seq, parallel, and jtbl. You also need programmatic access to an AWS account with a policy that allows you to perform the AWS actions. |
Beta Was this translation helpful? Give feedback.
-
It would be great to see that information baked into the documentation so that I know exactly which layer I need to use based on the Powertools version I need to support. |
Beta Was this translation helpful? Give feedback.
The documentation already has the data, but not all in one place.
Each semantic version's homepage shows the layer version that supports it.
The page for 3.10.0 shows layer version 12, The page for 3.9.0 shows layer version 11, and so on as described in the table above.