[PYTHON] Get a local DynamoDB environment with Docker

DynamoDB is an AWS service, but it is convenient to have a local environment during development. By the way, AWS officially distributes it http://docs.aws.amazon.com/ja_jp/amazondynamodb/latest/developerguide/DynamoDBLocal.html However, it depends on the installation environment, so you can easily make it with Docker.

Docker image

Some Docker images of DynamoDB have been released, but this time it seems to be the easiest https://hub.docker.com/r/tray/dynamodb-local/ I will use this.

Container startup

Start with the command in Description without thinking for the time being

7777 tray/dynamodb-local -inMemory -port 7777


 When I start it, I notice that "Oh, it wasn't running in the background", but that's fine for the time being.

## Communication confirmation
 Check communication with Python.

from boto.dynamodb2.layer1 import DynamoDBConnection conn = DynamoDBConnection(host='xxx.xxx.xxx.xxx', port=7777, aws_access_key_id='', aws_secret_access_key='', is_secure=False) conn.list_tables() {u'TableNames': []}

 Of course, the table doesn't exist because it's just started. If you can not connect, it will time out, so you can confirm the startup and communication safely.
 The rest is boiled or baked.


Recommended Posts

Get a local DynamoDB environment with Docker
[Linux] Build a jenkins environment with Docker
[Linux] Build a Docker environment with Amazon Linux 2
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Build a LAMP environment on your local Docker
[Python] Build a Django development environment with Docker
Get a quick Python development environment with Poetry
Prepare python3 environment with Docker
Build a development environment with Poetry Django Docker Pycharm
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
Build a Django development environment with Docker! (Docker-compose / Django / postgreSQL / nginx)
[Memo] Build a development environment for Django + Nuxt.js with Docker
[Django] Build a Django container (Docker) development environment quickly with PyCharm
Get a clean Python development environment with pyenv + pipx + Poetry
Create a simple Python development environment with VSCode & Docker Desktop
Create a Todo app with Django ① Build an environment with Docker
Building a kubernetes environment with ansible 2
Build a go environment using Docker
Build Mysql + Python environment with docker
Deploy a Django application with Docker
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build PyPy execution environment with Docker
Building a kubernetes environment with ansible 1
Rebuild Django's development environment with Docker! !! !! !!
Data science environment construction with Docker
Create a development environment for Go + MySQL + nginx with Docker (docker-compose)
I made a development environment for Django 3.0 with Docker, Docker-compose, Poetry
Postgres environment construction with Docker I struggled a little, so note
Create a C ++ and Python execution environment with WSL2 + Docker + VSCode
Create a simple Python development environment with VS Code and Docker
[Pyenv] Building a python environment with ubuntu 16.04
Competitive programming with python Local environment settings
Building a Python3 environment with Amazon Linux2
Easily build a development environment with Laragon
Build Jupyter Lab (Python) environment with Docker
Set up a Samba server with Docker
Build a Tensorflow environment with Raspberry Pi [2020]
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
Build a Fast API environment with docker-compose
Let's scrape a dynamic site with Docker
Create Python + uWSGI + Nginx environment with Docker
Create a virtual environment with Python_Mac version
To get a local IP address programmatically
Launch environment with LineBot + Heroku + Docker + Python
Run a Python web application with Docker
Build a python virtual environment with pyenv
Create a web service with Docker + Flask
A memo packed with RADEX environment construction
Build a modern Python environment with Neovim
Let's get along with Python # 0 (Environment construction)
Use WebDAV in a Portable Docker environment
Build NGINX + NGINX Unit + MySQL environment with Docker
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
Get a list of packages installed in your current environment with python
Build a CentOS Linux 8 environment with Docker and start Apache HTTP Server
Build a local server with a single command [Mac]
Build a C language development environment with a container
Hello World with gRPC / go in Docker environment
[Python] Get the files in a folder with Python