
❗️ In this video, we will develop and deploy a Lambda Function LOCALLY in VS Code using the AWS Toolkit Extension.
🧠 Developing locally speeds up the development cycle drastically.
If you’ve tried to make a Lambda Function for more than 5 minutes you’ve run into the problem of how to actually develop and debug it. You probably tried to use the IDE in the AWS console, but quickly realized there are some drawbacks.
The good news is that thanks to the AWS toolkit extension it’s actually really easy to develop Lambda functions in VS code then deploy them.
—
TIMESTAMPS:
0:00 Intro
0:10 How I Use Lambda
0:25 The Problem
1:21 Download AWS Toolkit
2:43 Create Lambda Function
4:32 Test
5:20 Deploy To AWS
7:09 Test In AWS
9:05 Conclusion
—
WHO AM I: I’m Dylan, a Cloud Engineer living in Oregon. I use my background in tech to make videos about technology that enables and grows businesses.
—
🌍 My website / blog –
https://dylanalbertazzi.com/
source
Wow, great tutorial. I am surprised I was able to get this working first try for something with so many moving parts
Much appreciated, this is very helpful. But it seems like it spawns a big octopus. I'd love to know if there's a minimalist way of connecting VSCode to Lambda just so we can code our functions, and get out of that console IDE in the browser.
What the fuck is the stupid music for
Thank you!!!!
Hi
could u plz help on the below error… what shall i do to overcome this error? Thank you in advance
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreauth.py", line 401, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials
Great tutorial Dylan, I'd only recommend blurring out your email address. You know, just in case.
Thanks for this video but unfortunately I am receiving the below error, I'd tried multiple things over google like aws configure etc but couldn't find the solution, can anyone help me regarding this?
"Error: Failed to create managed resources: An error occurred (InvalidClientTokenId) when calling the CreateChangeSet operation: The security token included in the request is invalid "
Thanks for the great tutorial, Dylan. This really sped up the configuration process for me. Subscribed!
Does deleting the app in lambda clean up all the aws resources associated with it?
I wish the music is not so loud…
Okay so if anyone else had trouble with the sam deploy –guided, there's a big rabbit hole there . First off, you need to download the SAM CLI, which allows you to use SAM. Straightforward download. Then afterwards, you'll need to have IAM roles configured for the SAM deploy to work. You'll need to have the AWS CLI installed. Also another straightforward download. Then you need to create an IAM role on (Good explanations online). And then finally, you can use the AWS CLI to configure the IAM role you created. Which will then grant the permissions necessary for sam to deploy the application.
good topic but low video definition makes it impossible to read, music makes it hard to follow the instruction
Great video!. I tried following along but I keep getting this Error:" Error: Error building docker image: pull access denied for public.ecr.aws/sam/emulation-nodejs12.x, repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again." Docker is running on my local machine.
hey, how do you mount the laptop
Dylan, I am confused why you would gloss over a key REQ with Docker and not include that in your video. Also I came to full stop after executing your first command as I needed SAM CLI which you also did not mentioned. Thanks
Great !!! 🙃
I learned Lamda functions within 10 minutes.
awesome. Thanks for putting this quick. You are quick to the point 👏👏👏
Great content Dylan! I am also a web developer in Bend. Currently working for Mazama Media. I’d love to chat with you about your experience with AWS certs as I find myself using more and more aws services in our development. I’ll head over to your site and submit a contact me so you have my information.
Excellent video. Thanks a lot for sharing.
Something a bit off-topic, I'm missing the 'Import' option when right clicking on already created lambda functions, also verified that same happens if I create a lambda following your instructions.
Once again thanks.
Underrated channel!!
Great video! I have problem with installing node module like axios does it have to go to the root folder or the function folder? Where I install I can't my app can't find the module when debugging locally.
Thanks for the video. On F5, I get "Cannot read property 'routeKey' of undefined" 🙁
The maximum is not 5 minutes, it is 15 minutes since end 2018 I think, but definitely more than a year
Is the Lambda function accessible from the Internet or do you have to add an API Gateway?
You look like a pro coder!
Very helpful, thanks!
how to install new dependencies after its been deployed on AWS? it tried clicking "deploy "after adding an extra dependency ( in my case requirement.txt for python but it didn't work out?
What's the song?
I like the video.
Great video! I love the bar at the bottom that shows how much progression is made per concept. Really really useful for following along I wish other tutorials did that!
you could switch to a smaller resolution before capturing so that it would be readable on a phone while playing
Dylan Albertazzi, thank you the video is a good tutorial and very well explained, but I have reached the point where it says SAM configuration environment [default]: and when I press enter I get the following error and I can not find a solution.
Could you give me some hint or clue please?
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamcli__main__.py", line 12, in <module>
cli(prog_name="sam")
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 829, in _call_
return self.main(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 782, in main
rv = self.invoke(ctx)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibcli_validationimage_repository_validation.py", line 76, in wrapped
return func(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickdecorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesclickcore.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibtelemetrymetric.py", line 153, in wrapped
raise exception # pylint: disable=raising-bad-type
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibtelemetrymetric.py", line 122, in wrapped
return_value = func(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibutilsversion_checker.py", line 42, in wrapped
actual_result = func(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamcliclimain.py", line 90, in wrapper
return func(*args, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclicommandsdeploycommand.py", line 206, in cli
do_cli(
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclicommandsdeploycommand.py", line 291, in do_cli
guided_context.run()
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclicommandsdeployguided_context.py", line 351, in run
self.guided_prompts(_parameter_override_keys)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclicommandsdeployguided_context.py", line 176, in guided_prompts
s3_bucket = manage_stack(profile=self.profile, region=region)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibbootstrapbootstrap.py", line 22, in manage_stack
outputs: StackOutput = manage_cloudformation_stack(
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibutilsmanaged_cloudformation_stack.py", line 86, in manage_stack
return _create_or_get_stack(cloudformation_client, stack_name, template_body, parameter_overrides)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagessamclilibutilsmanaged_cloudformation_stack.py", line 97, in _create_or_get_stack
ds_resp = cloudformation_client.describe_stacks(StackName=stack_name)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreclient.py", line 386, in _api_call
return self._make_api_call(operation_name, kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreclient.py", line 691, in _make_api_call
http, parsed_response = self._make_request(
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreclient.py", line 711, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreendpoint.py", line 102, in make_request
return self._send_request(request_dict, operation_model)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreendpoint.py", line 132, in _send_request
request = self.create_request(request_dict, operation_model)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreendpoint.py", line 115, in create_request
self._event_emitter.emit(event_name, request=request,
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocorehooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocorehooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocorehooks.py", line 211, in _emit
response = handler(**kwargs)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoresigners.py", line 90, in handler
return self.sign(operation_name, request)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoresigners.py", line 162, in sign
auth.add_auth(request)
File "C:Program FilesAmazonAWSSAMCLIruntimelibsite-packagesbotocoreauth.py", line 373, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials
Thanks mate. Now I learnt how easy that is to code lambda locally.
Dylan, its a great tutorial . Could you please help us to run GLue job locally on vs code?
Thanks, well illustrated
What is the Screen + laptop stand you are using ? looking for something than can support laptio and 34 inch
screen
Hey thanks Dylan for the great video. btw, is there any way to get rid of debugger stops at line 10 at const RAPIDClient = require("./RAPIDClient.js"); ?
Hello sir,great video. Please can you teach me how to upgrade lamnda functions for python 2.6 to 3.0?
Thanks so much for your help
Hey thanks Dylan for the great video. btw, is there any way to get rid of debugger stops at line 10 at const RAPIDClient = require("./RAPIDClient.js"); ?