

#Run local dynamodb shareddb location install#
You may do this by running the command brew tap aws/tap followed by brew install aws-sam-cli - obviously this requires Homebrew. Presuming you have DynamoDB running in a Docker container, download and install SAM CLI (Serverless Application Model) if you haven't done so.

Every time you restart your container (restart Docker, restart your computer) all data will be erased as it is only saved into the container's memory. If for any reason the above command doesn't work, you may try a non-persistent containerized version of DynamoDB by running the below command:ĭocker run -p 8000:8000 amazon/dynamodb-local. If you're storing your DynamoDB's data somewhere else you'll need to specify that folder location. This terminal window will need to remain open as you use DynamoDB.Īgain, notice the -dbPath /data.
#Run local dynamodb shareddb location software#
Once you have all the software downloaded you should be able to run DynamoDB locally using the below command:ĭocker run -p 8000:8000 -v $(pwd)/local/dynamodb:/data/ amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath /data. I selected a generic folder of /data (where I also store MongoDB's data) and will pass it as a flag to run a containerized version of DynamoDB.

In order to persist data you'll need a folder for the containerized version of DynamoDB to save data. After making those changes you'll have to select Apply & Restart. You also need to ensure Docker can containerize DynamoDB - I installed DynamoDB in the folder /dynamodb so I provided that location to Docker as well (as pictured above). My local applications run in the /apps folder so I've added it. NOTICE - If you don't take this step you will receive an "Internal server error"Įnsure Docker and DynamoDB can run locally by adding your application and dynamodb folders to Docker's File Sharing directories by selecting Preferences from the Docker menu. Once downloaded, run the command docker pull amazon/dynamodb-local to pull the DynamoDB Image - this is provided by AWS and will containerize DynamoDB locally. If you don't have Python and Homebrew you'll need to get those. What You Needīelow is the software you need to install (all instructions for use on a Mac):ĮIGHT programs!?!?!? - I realize that's a lot - you may already have a few of them. This tutorial provides complete instructions to accomplish this.Ĭontact me if you run into problems using this repo or tutorial. Run AWS SAM with DynamoDB locally READ CAREFULLY - Skipping steps will likely reduce your chances of success There are multiple steps to run Lamdba functions locally which connect to a containerized instance of DynamoDB.
