Developing AWS Lambda Functions Locally in VS Code

Developing AWS Lambda Functions Locally in VS Code

Travis Media

2 года назад

115,724 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Shantisagar Gebise
Shantisagar Gebise - 06.11.2023 15:33

Very well explained. Easy to understand and grasp.

Ответить
one
one - 15.10.2023 11:36

This content has my full endorsement! If you're interested, there’s a book I’d recommend. "AWS Unleashed: Mastering Amazon Web Services for Software Engineers" by Harrison Quill

Ответить
Karl Ang
Karl Ang - 21.06.2023 07:51

If you delete the stack, would the lambda functions get deleted too?

Ответить
Rohit Sharma
Rohit Sharma - 10.06.2023 18:12

That was very helpful

Ответить
Kofi O
Kofi O - 17.04.2023 18:57

Thanks Travis, Great Video! BTW - To delete the stack is: sam delete sam-app
This was probably added post your video.

Ответить
Avia Hadar
Avia Hadar - 22.03.2023 17:08

Great video it helps a ton.
one question: if I want to do that with some Python libraries, where should I install those libraries, locally in the same folder (in your example "aws-sam")? something like pip install "library name" -t . ?

Ответить
Vinícius Henrique
Vinícius Henrique - 27.02.2023 22:24

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.

Ответить
iambords
iambords - 22.01.2023 02:27

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 👍

Ответить
Karsten Silkenbäumer
Karsten Silkenbäumer - 30.09.2022 22:45

`sam delete` to delete the whole stack

Ответить
Karsten Silkenbäumer
Karsten Silkenbäumer - 30.09.2022 22:17

Looks like aws-sam-cli doesn't provide an `aws` cli anymore. Only one called `sam` - which however doesn't come with a `configure` command. So stuck at the very beginning. Trying to follow along and see when it breaks…

Ответить
John Danson
John Danson - 28.09.2022 02:17

Been doing this for 4 years, but I have a feeling you're doing it 99% suboptimally. Understanding how to set breakpoints, step-through code is the biggest advantage. Equally hopping between regions and accounts is also possible. Plenty of yaml-ers on this site but no devs.

Ответить
kaidobit
kaidobit - 14.09.2022 02:16

the aws configure step + your script to get sts generating a token for you could be easily replaced using aws-vault, have a look at that

Ответить
Nataraj Purudappa
Nataraj Purudappa - 05.08.2022 23:15

sam delete --stack-name <stackname> is to delete the stack

Ответить
Asif Rasool
Asif Rasool - 27.07.2022 18:46

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..

Ответить
Saeed Uchiha
Saeed Uchiha - 02.07.2022 11:18

In my environment, were devops team locks every thing and use TerraForm for deployment, is there a way to ONLY handle development/testing locally? Without needing the permission to create lambda

Ответить
Waldo Jams
Waldo Jams - 26.06.2022 18:43

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.

Ответить
Mohammed Banabila
Mohammed Banabila - 20.06.2022 06:49

thanks for video but i have question , can be use boto3 in sam app

Ответить
Demian N
Demian N - 08.06.2022 00:28

This was just what I needed. Thanks!

Ответить
Fabio Fusco
Fabio Fusco - 16.05.2022 14:01

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!

Ответить
thelonious1234
thelonious1234 - 13.05.2022 16:26

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.

Ответить
Jose Madrid
Jose Madrid - 04.05.2022 03:59

Can I test a CommonLayer locally using the same steps?

Ответить
Ganesh Kharad
Ganesh Kharad - 27.04.2022 08:23

what if there is an existing Lambda function and we want to import it to the local environment to work??
I don't see template.yml getting downloaded for that.
there should be a way to generate it even if lambda is not created with SAM.
if you know the answer do share it.

Ответить
RandyL86
RandyL86 - 15.04.2022 00:14

Great tutorial! You were super clear and informative.

Question for you: how do you get your terminal command line to bring up the past commands you've entered? That seems super useful. I searched but can't find how to enable it.

Ответить
Ali Alouane
Ali Alouane - 13.04.2022 13:00

Thanks man !

Ответить
Partha Das
Partha Das - 29.03.2022 15:29

sam has cli command "sam delete"

Ответить
Евгений Данильченко
Евгений Данильченко - 09.03.2022 21:34

Great! It is very clear explanation and very helpful!

Ответить
A R
A R - 03.03.2022 03:45

How do you set a breakpoint?

Ответить
brian dines
brian dines - 02.03.2022 17:51

Nicely done. Good clean explanation.

Ответить
raghav gautam
raghav gautam - 01.03.2022 15:14

Great man! Thank you so much!
You are a great instructor.

Ответить
Damian Danev
Damian Danev - 25.01.2022 04:55

A mock service... a waste of time really. Apart from a hardcoded hello-world, SAM is useless. You can't access any databases or any other service for that matter. Define your lambdas as docker containers and use AWS CDK, have your databases running in containers as well. I wonder how long will it take for SAM to be deprecated.

Ответить
Thinh Do
Thinh Do - 07.01.2022 01:55

game changer! thank you for this sir

Ответить
Zac Sanders
Zac Sanders - 13.12.2021 21:48

solid video - thank you

Ответить
Steve Yoo
Steve Yoo - 13.12.2021 19:55

travis, this was very helpful!

Ответить
VeganLife
VeganLife - 20.11.2021 17:01

Hey Travis, best sam tutorial I've came across. deserves the sub

Ответить
jckdmxnnxd
jckdmxnnxd - 02.11.2021 15:42

hi, how to debug the code?

Ответить
sod16
sod16 - 02.10.2021 11:58

Awesome instructional video. This way of working helps cut out so much nonsense when it comes to working with lambdas!

Ответить
Chris MacSwan
Chris MacSwan - 23.09.2021 21:45

Oh my god thank you so much for that MFA script. You are a life saver.

Ответить
Sushanta Samantaray
Sushanta Samantaray - 15.09.2021 22:17

Amazing tutorial

Ответить
Aditya Tulsyan
Aditya Tulsyan - 12.09.2021 09:11

It was really helpful, please release more such videos. Thank You.

Ответить
Jag Singh
Jag Singh - 10.09.2021 22:39

Amazing tutorial! Very helpful

Ответить