Developing lambdas - AWS SAM with VSCode and Linux: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 158: Line 158:
=== Debugging ===
=== Debugging ===
Once you open a file which you want to debug, add python code for debug, launch "sam local invoke" and click on debugging icon in VS Code. If you have your breakpoints selected you should be fine. Only thing which does not worked correctly for me is stopping on uncaught exceptions - [https://github.com/awslabs/serverless-application-model/issues/1613 Ticket I opened with AWS, still unresolved]
Once you open a file which you want to debug, add python code for debug, launch "sam local invoke" and click on debugging icon in VS Code. If you have your breakpoints selected you should be fine. Only thing which does not worked correctly for me is stopping on uncaught exceptions - [https://github.com/awslabs/serverless-application-model/issues/1613 Ticket I opened with AWS, still unresolved]
== Working with SAM ==
Install following documentation https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html
==== Installing homebrew on Ubuntu ====
<syntaxhighlight lang="bash">
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
</syntaxhighlight>
==== Edit ~/.profile ====
<syntaxhighlight lang="bash">
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
</syntaxhighlight>
==== Install awscli ===
<syntaxhighlight lang="bash">
sudo apt install python3-pip
sudo pip3 install awscli
aws configure
</syntaxhighlight>

Navigation menu