Developing AWS Lambda Functions Locally in VS Code

113,818
0
Published 2021-09-08
n this video, I want to share the approach I use regularly to develop AWS Lambda functions (and other serverless projects) locally in VS Code using the benefits of AWS's secret sauce, SAM.

AWS SAM, or Serverless Application Model, is a framework that makes managing your serverless AWS service easy. Using the CLI was can create Lambda functions locally, test them, update them, and deploy them, all from our favorite code editor (mine being VS Code).

In this video, we'll create a simple AWS Lambda function locally and I'll show you how to manage it all from your local dev environment.

Video Mentions:
Read the Blog Post: travis.media/developing-aws-lambda-functions-local…
MFA Script: gist.github.com/rodgtr1/6ae49449b836ff617ed0b0863c…
My #1 Favorite Udemy Course of 2021: geni.us/58VWIe
How to Pass The AWS Solutions Architect:    • Pass the AWS Solutions Architect in 2...  

How I Learned to Code at 34 and Changed Careers:    • How I learned to code at 34 and chang...  

*** Get ONE FREE Month on Skillshare. Learn Anything (preferably code 😁) ***
🎓 geni.us/DqB7m

*** I write regularly ***
👉 travis.media/

*** Learn to Code Blueprint 6 Month ***
🎓 geni.us/HoswN2

*** FREE EBOOKS ***
📘 bit.ly/2jnH2DP​

LET'S CONNECT!
📰 LinkedIn ➔ www.linkedin.com/in/travisdot...
🐦 Twitter ➔ twitter.com/travisdotmedia​
🙋🏼‍♂️ Website ➔ travis.media/

#developawslambdafunctions #awssam #serverless #awslambda

** Some of the links in this description are affiliate links that I may get a little cut of. T

All Comments (21)
  • @asifrasool573
    Travis, you are just awesome. I had the issue with importing different python dependencies, mainly snowflake and sql alchemy, I tried a lot with layers and didn't want to shift to linux. I watched this video 3 days ago. But I was stuck in installing Docker, SAM CLI, and also I had Federated AWS Account. I fixed everything and came back to this video. You have saved me. Great tutorial and complete explanation. Thank you so much for this great content..
  • @sod16
    Awesome instructional video. This way of working helps cut out so much nonsense when it comes to working with lambdas!
  • thank you! I was dreading a new uphill battle, but you turned learning SAM into a water slide :D
  • Oh my god thank you so much for that MFA script. You are a life saver.
  • Cheers, this is by far the best available explanation of this. But I really wish there was a more straightforward means of escape from the horrorshow browser IDE -- i.e. without SAM, CloudFormation, etc. I guess there's manually building and pushing zip files, but that's no bed of roses either. I seem to keep landing back in the console IDE when I just need to get something done with Lambda.
  • 19:02 and 19:58 You probably know now, but, for the people seeing that now, the AWS SAM CLI, have the command "delete" that delete all resources in the stack that you created. example: "$ sam delete <name-stack>"
  • Now this is just amazing. I'll use AWS SAM a lot now, thanks! Only thing missing from this tutorial I think would be a small intro on managing Lambda Layers with AWS SAM too.
  • @veganlife9190
    Hey Travis, best sam tutorial I've came across. deserves the sub
  • @rugeneus
    Great! It is very clear explanation and very helpful!
  • @fabiofusco6944
    Hi Travis, thanks a lot. Great tutorial. I have a question if you don't mind: how can I import dependencies in the local environment? Right now I use Layers, but they seem to not be imported locally. Thanks a lot!
  • @waldojams
    That's a neat and modern workflow! Wondering how debugging would work though. Cool thing about a fully functional approach is that it isolates dependencies and work with arguments, which generally make debugging easier. But I have no experience of working with this in a big environment. Looking forward to commit to use in in a bigger project.
  • @bordsUK
    Great tutorial. I am wondering what if you want to export existing lambda function and debug it locally in vscode. Would love to see that. Keep up the good work 👍
  • @kofio7581
    Thanks Travis, Great Video! BTW - To delete the stack is: sam delete sam-app This was probably added post your video.