Setting up DynamoDB locally
A commonly used Database on AWS is DynamoDB. DynamoDB is a serverless key/value NoSQL database. For local testing, AWS provides us with a local version of DynamoDB.
We shall use the Docker images provided by AWS and add them to the Compose configuration. For convenience, we shall expose the port locally.
As mentioned before, the DynamoDB service will use the private network defined previously:
services: dynamodb: image: amazon/dynamodb-local ports: - 8000:8000 networks: - aws-internal
Since DynamoDB locally is up and running, let’s create a table on it.
Creating DynamoDB tables
Unlike Redis, in DynamoDB we need to create a table beforehand. We shall add a container to the Compose application, which creates the table in DynamoDB.
We did something similar to this in Chapter 2, Running the...