docker run --rm -p 8000:8000 -v /tmp:/data amazon/dynamodb-local
docker inspect <container_name_or_id> -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
aws dynamodb create-table --table-name clients --attribute-definitions AttributeName=userId,AttributeType=S AttributeName=clientId,AttributeType=S AttributeName=clientName,AttributeType=S AttributeName=email,AttributeType=S --key-schema AttributeName=userId,KeyType=HASH AttributeName=clientId,KeyType=RANGE --local-secondary-indexes "[{\"IndexName\": \"clientNameIndex\",\"KeySchema\": [{\"AttributeName\": \"userId\", \"KeyType\": \"HASH\"},{\"AttributeName\": \"clientName\", \"KeyType\": \"RANGE\"}],\"Projection\": {\"ProjectionType\": \"ALL\"}},{\"IndexName\": \"emailIndex\",\"KeySchema\": [{\"AttributeName\": \"userId\", \"KeyType\": \"HASH\"},{\"AttributeName\": \"email\", \"KeyType\": \"RANGE\"}],\"Projection\": {\"ProjectionType\": \"ALL\"}}]" --billing-mode PAY_PER_REQUEST --endpoint-url http://localhost:8000
{
"getByIdFunction": {
"ENDPOINT_OVERRIDE": "http://172.17.0.2:8000",
"SAMPLE_TABLE": "Table"
},
"putItemFunction": {
"ENDPOINT_OVERRIDE": "http://172.17.0.2:8000",
"SAMPLE_TABLE": "Table"
}
}
sam local start-api --env-vars env.json --host 0.0.0.0 --debug
aws dynamodb scan --table-name Table --endpoint-url http://127.0.0.1:8000