I have a lambda layer which I keep updating. This lambda layer has multiple versions. How can I find the lambda layer ARN with latest version using aws cli?
The qualified ARN for each Lambda function version is unique. After you publish a version, you can't change the ARN or the function code.
An Amazon Resource Name (ARN) is a file naming convention used to identify a particular resource in AWS and they uniquely identify AWS resources. If you successfully created a Lambda function (Independently if it is triggered by Alexa Skills Kit or not) you will get an ARN.
A Lambda layer is an archive containing additional code, such as libraries, dependencies, or even custom runtimes. When you include a layer in a function, the contents are extracted to the /opt directory in the execution environment.
For a Lambda function, there is a maximum of 5 layers and a maximum size for all layers of 250 MB (uncompressed). This maximum applies regardless of whether you are using an official AWS runtime or a custom runtime.
I am able to do this using the command listed below -
aws lambda list-layer-versions --layer-name <layer name> --region us-east-1 --query 'LayerVersions[0].LayerVersionArn'
Unfortunately, it's currently not possible (I have encountered the same issue).
You can keep the latest ARN in your own place (like DynamoDB) and update it whenever you publish a new version of the layer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With