Skip to content

Instantly share code, notes, and snippets.

@ng-the-engineer
Last active July 26, 2020 17:43
Show Gist options
  • Save ng-the-engineer/1f3b9bc61ab718ba36b9a6fe0b4f5289 to your computer and use it in GitHub Desktop.
Save ng-the-engineer/1f3b9bc61ab718ba36b9a6fe0b4f5289 to your computer and use it in GitHub Desktop.
Setup DynamoDB in a local machine

Setup Local DynamoDB

  1. Download local DynamoDB
  2. Unzip to a local folder
> mkdir ~/mydynamodb
> cd ~/mydynamodb
> unzip -a ~/Downloads/dynamodb_local_latest.zip
  1. Start the database (specify the port by adding -port xxxx)
> java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb -port 9001
  1. You will see below message
Initializing DynamoDB Local with the following configuration:
Port:	9001
InMemory:	false
DbPath:	null
SharedDb:	true
shouldDelayTransientStatuses:	false
CorsParams:	*
  1. Connect to the database and list tables (AWS CLI is required)
> aws dynamodb list-tables --endpoint-url http://localhost:9001
  1. The list should be empty at this moment
{
  "TableNames": []
}

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment