Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running AWS SAM projects locally get error

I am trying to run an AWS Lambda project locally on Ubuntu. When I run the project with AWS SAM Local it shows me this error: Error: Running AWS SAM projects locally requires Docker. Have you got it installed?

like image 732
Santosh Silwal Avatar asked Jun 11 '18 06:06

Santosh Silwal


People also ask

What is AWS Sam local?

AWS SAM Local is a CLI tool that allows you to locally test and debug your AWS Lambda functions defined by AWS Serverless Application Model (SAM) templates. Today, SAM Local supports Lambda functions written in Node. js, Java, and Python. SAM Local is available today in beta.


1 Answers

I had trouble installing it on Fedora.

When I followed the Docker postinstall instructions I managed to get past this issue.

https://docs.docker.com/install/linux/linux-postinstall/

I had to:

  1. Delete the ~/.docker directory;
  2. Create the "docker" group;
  3. Add my user to the "docker" group;
  4. Logout and back in again;
  5. Restart the "docker" daemon.

I was then able to run the command:

sam local start-api
like image 86
Dystopic64 Avatar answered Sep 19 '22 12:09

Dystopic64