Does the layer inherit the Lambda function's runtime version if I don't choose a compatible runtime when I create the layer?

0

We use Node.js runtimes for our Lambda functions. When I create a layer, the compatible runtime selection is optional. If I don't set the value, does the layer inherit the runtime version from the Lambda function? Is it mentioned in any Lambda documentation?

已提問 1 個月前檢視次數 101 次
1 個回答
1
已接受的答案

The compatible runtimes parameter when creating a layer determines which layers are displayed when adding a layer to a function, but does not affect actual layer compatibility. If no compatible runtimes are specified for a layer, Lambda will invoke functions using that layer against any of Lambda's supported runtimes. The "compatible runtimes" property does not enforce true compatibility at the runtime level - it is simply metadata that controls layer discoverability.

AWS
Jainam
已回答 1 個月前
profile picture
專家
已審閱 25 天前
profile picture
專家
已審閱 1 個月前
  • Thanks for the response. Would like to clarify with an example here. If the Lambda function's runtime is Node.js 20.x but the compatible runtimes of the layer is 16.x, when the Lambda function is invoked, does the code in the layer run on 20.x or 16.x?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南