Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup PyCharm to develop AWS Lambda function on local machine?

I am looking forward to developing some AWS lambda functions in python using PyCharm. How can I setup my IDE to develop and test the function locally? Can experts guide how to set it up? Any links or relevant tutorials will be really helpful.

like image 518
exan Avatar asked Nov 27 '18 06:11

exan


People also ask

How do I create a Lambda function in PyCharm?

Then, with IntelliJ IDEA, PyCharm, WebStorm, or JetBrains Rider already running, do one of the following: Open AWS Explorer, if it isn't already open. If you need to switch to a different AWS Region to create the function in, do that now. Then right-click Lambda, and choose Create new AWS Lambda.

Can Lambda functions be installed locally?

You will need to install AWS CLI, AWS SAM CLI and Docker to invoke a Lambda function locally.


2 Answers

As of the announcement at the re:Invent 2018 keynote, Jetbrains now offers the AWS Toolkit which allows local and remote development of Lambda functions.

Despite some lingering issues it works quite well.

User exan has provided the link on AWS' site here

There is also a blog post when using PyCharm on MacOS

Toolkit page on Jetbrains website

UPDATE April 2019: Jetbrains has been very responsive and active in fixing any issues. Issues with credentials and templates seem resolved and it's quite a joy to work with.

like image 177
Marakai Avatar answered Oct 22 '22 20:10

Marakai


Directly go through the page-> https://medium.com/@bezdelev/how-to-test-a-python-aws-lambda-function-locally-with-pycharm-run-configurations-6de8efc4b206

pip install python-lambda-local
python-lambda-local -f lambda_handler lambda_function.py event.json
like image 34
Manikandan Kathir Avatar answered Oct 22 '22 22:10

Manikandan Kathir