Awesome info, gave you a thumbs-up, of course. Two suggestions: 1. Show a simple diagram that explains install docker, create a container, then a python environment in that container, which then does all the work and spits out the zip file with the library outside the container (a picture is worth a thousand words). 2. Suggest using virtual box with a Linux VM as an alternative - not everyone like containers :)
I had issues like image named aws_lambda_builder_image, you should first build it with "docker build . -t aws_lambda_builder_image" Then in runner_sh, add quotes on $container_name and $docker_image. It should look like "$container_name"
Though the layer didn't work in my Lambda function. I got this error. "Unable to import module 'lambda_function': No module named 'pandas'" I did add both layers in Lambda function. And selected Python 3.8 for Lambda and Layers.
Hi, this did not work for me. It would be good if you would consider those of us who are starting at this point or at least direct us to resources to have all the libraries and dependencies installed and ready for this to work. I am supposing that there are dependencies missing since I am starting at this point. I'm going to look for a video that can give me the full setup and running. Thanks though
Hey Felix quick Question, Why not create 1 layer with all your commonly used packages and reuse it for your different projects instead of a separate layer for individual packages? Can you go either way as your preference?
We can certainly create a layer with all the commonly used packages (that’s what a lot of ppl do at work actually). One thing to watch out for is..projects evolve over time, we will needa adjust the layers over time when new projects are added and stuff
Thank you for explaining the layers concept. How are these layers helpful in production ? Because I don't want to edit the code on console in production and moreover the code is shared in the repo. Can we pass handler to layer along with libs to execute my business logic instead of editing directly on console ?
Didn't work. I got this error. "Unable to import module 'lambda_function': No module named 'pandas'" I did add both layers in Lambda function. And selected Python 3.8 for Lambda and Layers.
i'm stuck when trying to import confluent_kafka as a layer, it keeps saying can't find confluent_kafka.cimpl. I've even tried what you showed as 1:09, still same problem (as just a work around). curious, is there a permission that needs to be assigned to a lambda function to get access to a lambda layer ?
maybe ignore me for now. lookalike your video might be covering my problems. are your files you create available by any chance, otherwise we have to retype it allllll
docker: Error response from daemon: pull access denied for aws_lambda_builder_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
VERY DISAPPOINTING! The solution is half baked, and half explained and half demonstrated. DON'T WASTE YOUR TIME on this video and author. I should have guessed as soon as I saw that there is no repo to copy the scripts from and I had to type them.
Thanks for the video, it was very clear and precise, In the same way, I wanted to use the azure-identity package with my aws lambda function so for that purpose I created a directory and installed the azure-identity package using the pip command then converted it into a zip file and uploaded it to AWS lambda function along with function.py file. When I ran the script I got the import error stating that Error Message: { "errorMessage": "Unable to import module 'lambda_function': cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)", "errorType": "Runtime.ImportModuleError", "requestId": "3e17800f-0330-40f5-af54-69d860fbfdc1", "stackTrace": [] } which is the dependent package for the azure-identity package. I would be grateful if you could please help me on how to fix this issue.
@@sherrygirgis9540 I'm sorry, but the author may have deleted it. If I'm not misstaken, at the end what I did was to set up the packages in a layer via AWS CLI directly and upload to lambda from there.
you are first who explained about Linux/ Mac differences
very very very good tutorial! If all tutorials were made like this our lives would be significantly easier.
Great video. Thanks. Somethings were missing but still helped a lot
Awesome info, gave you a thumbs-up, of course. Two suggestions: 1. Show a simple diagram that explains install docker, create a container, then a python environment in that container, which then does all the work and spits out the zip file with the library outside the container (a picture is worth a thousand words). 2. Suggest using virtual box with a Linux VM as an alternative - not everyone like containers :)
Thanks for the detailed explanation, for window user you might want to change /bin/bash to //bin//bash
Thanks for detailed info
I had issues like image named aws_lambda_builder_image, you should first build it with "docker build . -t aws_lambda_builder_image"
Then in runner_sh, add quotes on $container_name and $docker_image. It should look like "$container_name"
Thank you for writing this. I was stuck at this step.
Though the layer didn't work in my Lambda function. I got this error. "Unable to import module 'lambda_function': No module named 'pandas'"
I did add both layers in Lambda function. And selected Python 3.8 for Lambda and Layers.
Hi, this did not work for me. It would be good if you would consider those of us who are starting at this point or at least direct us to resources to have all the libraries and dependencies installed and ready for this to work. I am supposing that there are dependencies missing since I am starting at this point. I'm going to look for a video that can give me the full setup and running. Thanks though
I posted the solution on the comments.
Hey Felix quick Question, Why not create 1 layer with all your commonly used packages and reuse it for your different projects instead of a separate layer for individual packages? Can you go either way as your preference?
We can certainly create a layer with all the commonly used packages (that’s what a lot of ppl do at work actually). One thing to watch out for is..projects evolve over time, we will needa adjust the layers over time when new projects are added and stuff
I posted the solution on the comments.
Great job, great information, very relevant, very important
Thanks mate!!
Thank you for explaining the layers concept. How are these layers helpful in production ? Because I don't want to edit the code on console in production and moreover the code is shared in the repo. Can we pass handler to layer along with libs to execute my business logic instead of editing directly on console ?
build the image first docker build . -t aws_lambda_builder_image
@Felix you forgot to mention this step
Great video! Thank you. Can you supply the code you pasted?
Thank you. Let me check if I save it!!
I posted the solution on the comments.
Didn't work. I got this error. "Unable to import module 'lambda_function': No module named 'pandas'"
I did add both layers in Lambda function. And selected Python 3.8 for Lambda and Layers.
i'm stuck when trying to import confluent_kafka as a layer, it keeps saying can't find confluent_kafka.cimpl.
I've even tried what you showed as 1:09, still same problem (as just a work around).
curious, is there a permission that needs to be assigned to a lambda function to get access to a lambda layer ?
maybe ignore me for now. lookalike your video might be covering my problems.
are your files you create available by any chance, otherwise we have to retype it allllll
trying to map your instructions onto how to make this work on a M1 based MAC.
I've been stuck for ages wondering why my package wasnt working. I was using windows and the Lambda linux xD
docker: Error response from daemon: pull access denied for aws_lambda_builder_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
I am getting same error, any solution for this?
Too much for a lambda layer. Why would you even use docker?
VERY DISAPPOINTING! The solution is half baked, and half explained and half demonstrated. DON'T WASTE YOUR TIME on this video and author. I should have guessed as soon as I saw that there is no repo to copy the scripts from and I had to type them.
Thanks for the video, it was very clear and precise, In the same way, I wanted to use the azure-identity package with my aws lambda function so for that purpose I created a directory and installed the azure-identity package using the pip command then converted it into a zip file and uploaded it to AWS lambda function along with function.py file. When I ran the script I got the import error stating that
Error Message: {
"errorMessage": "Unable to import module 'lambda_function': cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)",
"errorType": "Runtime.ImportModuleError",
"requestId": "3e17800f-0330-40f5-af54-69d860fbfdc1",
"stackTrace": []
} which is the dependent package for the azure-identity package. I would be grateful if you could please help me on how to fix this issue.
does not work on windows
I posted the solution on the comments.
@@faynercosta7134 where's the solution?
@@sherrygirgis9540 I'm sorry, but the author may have deleted it.
If I'm not misstaken, at the end what I did was to set up the packages in a layer via AWS CLI directly and upload to lambda from there.
this is old
p̳r̳o̳m̳o̳s̳m̳
I posted the solution on the comments.