Architecture combinations between lambdas and layers

0

Hi,

Any information or insights into what combinations of architectures work between lambdas and the layers attached to them? For example I have a lambda with two attached layers. One layer is arm64, one is x86_64.

If the lambda is built as an x86_64 this all works. If it's built as an arm64 lambda it doesn't (unmet dependencies errors):

WORKS:            lambda (x86_64) -> layer1 (arm64) -> layer2 (x86_64)
DOESN'T:          lambda (arm64)  -> layer1 (arm64) -> layer2 (x86_64)

Runtime is Nodejs18.x for everything.

How do layers work anyway? I thought they were like "included" files, but the fact that shared libraries and so on can be included suggests they're more like compiled/linked binaries. Any pointers would be very interesting.

David

dmb0058
질문됨 9달 전236회 조회
2개 답변
0

Lambda layers are just a way to add files to the lambda execution environment. All the files in the Layer (which is a zip file) are extracted to the /opt folder.

You should not mix them, however, if you are using a runtime like Python or Node which uses interpreted code, it may work. Python sometimes also includes binary dependencies, so that might cause issues. Not sure about Node.js.

profile pictureAWS
전문가
Uri
답변함 9달 전
0

Thanks Uri,

That fits with what I'm seeing.

My guess is that the architecture of the lambda is used to select the hardware that it's run on:

x86 lambda (Node) + ARM layer (Node) + x86 layer (binary) would work when unbundled onto an x86 processor because the Node elements would be interpreted appropriately on either platform but wouldn't work if deployed to an ARM processor because the binary layer wouldn't run.

David

dmb0058
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠