How to upload node js application to lambda via s3

Have you ever had to rush back home just to check if you’ve switched off your geyser? If your answer is yes, you’ll surely appreciate this fast-growing industry of home automation. As we progress towards a digital era, smart devices are becoming more common, and so are smart homes. In today’s fast-paced environment, this convenient technology will make your life easier, relaxed, and happier.

Step-2: Once the bucket is created select the bucket and select upload

Step-3: Browse to where your .zip file is located in your system (Note: It must contain all the dependencies required by the program inside the .zip file along with its corresponding package.json file for lambda to execute successfully)

Step-4: After clicking on open click next to go to set permissions and make sure the bucket has read and write access so lambda can access the bucket and its data when required

Step-5: Click upload

Step-6 Go to your bucket, Select the .zip file as shown and copy its object URL onto your clipboard, This will be used in Step-10

Step-7: Go to services, Select lambda and then create function

Step-8: Click on your newly created lambda function scroll down under configuration and look for Execution role, Under that make sure you use a role which has S3 read and write access(Refer to this link

Step-9: Now scroll up to Function code and select Code entry point and under that select Upload file from S3

Step-10: Paste the S3 object URL and click save

Step-10: Paste the S3 object URL and click save

Step-11: Run your lambda function


This is the best practice to upload your code to lambda when code size is ≥ 10 Mb since S3 provides a more stable upload and lambda can access your application using the internal amazon network

Leave a Reply

Your email address will not be published. Required fields are marked *