Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latest Lambda Layer ARN

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?

like image 787
Punter Vicky Avatar asked Apr 18 '19 15:04

Punter Vicky


People also ask

Does lambda ARN change?

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.

What is lambda Arn?

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.

What is lambda layer version?

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.

What is the max size of lambda layer?

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.


2 Answers

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'
like image 196
Punter Vicky Avatar answered Sep 28 '22 00:09

Punter Vicky


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.

like image 42
Ronyis Avatar answered Sep 28 '22 01:09

Ronyis