{"id":20041065,"url":"https://github.com/kdico/dynamodb-local-demo","last_synced_at":"2026-04-10T11:02:00.034Z","repository":{"id":42671865,"uuid":"429105312","full_name":"kdico/dynamodb-local-demo","owner":"kdico","description":"A minimal template repository about AWS tools for working with a local DynamoDB, NoSQL Workbench, and a Lambda function.","archived":false,"fork":false,"pushed_at":"2022-03-29T00:54:23.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T22:49:07.952Z","etag":null,"topics":["aws","aws-lambda","docker-compose","dynamodb-local","nodejs","nosql-workbench"],"latest_commit_sha":null,"homepage":"https://medium.com/gecogeco/aws-nosql-workbench-dynamodb-local-d47cea1e7234?source=friends_link\u0026sk=542fc087e07321721d47ca2d81ca344a","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-17T15:44:15.000Z","updated_at":"2024-08-06T14:20:31.000Z","dependencies_parsed_at":"2022-08-28T09:00:33.859Z","dependency_job_id":null,"html_url":"https://github.com/kdico/dynamodb-local-demo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kdico/dynamodb-local-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdico%2Fdynamodb-local-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdico%2Fdynamodb-local-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdico%2Fdynamodb-local-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdico%2Fdynamodb-local-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdico","download_url":"https://codeload.github.com/kdico/dynamodb-local-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdico%2Fdynamodb-local-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","docker-compose","dynamodb-local","nodejs","nosql-workbench"],"created_at":"2024-11-13T10:45:04.811Z","updated_at":"2026-04-10T11:02:00.016Z","avatar_url":"https://github.com/kdico.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DynamoDB Local Demo\n\nA minimal template repository about AWS tools for working with a local DynamoDB, NoSQL Workbench, and a Lambda function.\n\nThis is part of the Medium article [AWS NoSQL Workbench \u0026 DynamoDB Local](https://medium.com/gecogeco/aws-nosql-workbench-dynamodb-local-d47cea1e7234?source=friends_link\u0026sk=542fc087e07321721d47ca2d81ca344a) which you can view for free.\n\n## Requirements\n\n* Docker Compose\n* AWS NoSQL Workbench (Optional)\n* AWS CLI (Optional)\n* A reasonable amount of free disk space for Docker images.\n\n## Docker Compose Services\n\n* `dynamodb-local`\n  * This is the local DynamoDB service without pre-existing data.\n  * Accessible from the endpoint `http://localhost:8000` when using the AWS CLI or SDK.\n  * For the rest of the services, the endpoint is `http://dynamodb-local:8000`.\n  * Uses `amazon/dynamodb-local:1.17.0` from October 12, 2021 as the base image. See [amazon/dynamodb-local](https://hub.docker.com/r/amazon/dynamodb-local/tags).\n* `cli`\n  * This service creates a table in the `dynamodb-local` service using `./cli/create-table.sh` along with a GSI defined in `./cli/gsi.json`.\n  * After `./cli/create-table.sh` executes, this service exits.\n  * Uses `amazon/aws-cli:2.3.6` from November 12, 2021 as the base image. See [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli/tags).\n* `function`\n  * A Lambda function you can `POST` to from `http://localhost:9000/2015-03-31/functions/function/invocations`. See [Invoke Lambda Function](#invoke-lambda-function).\n  * Written in Node.js.\n\n## Setup\n\nProvided you've got Docker installed and running, spin up the services from `docker-compose.yml`.\n```\ncd ./dynamodb-local-demo/\ndocker-compose up\n```\n\nThe following events should happen.\n1. `dynamodb-local` service starts.\n2. `cli` service creates the `DemoTable` and `GSI1Index`.\n3. `cli` service exits gracefully.\n4. `function` service starts.\n\n## Invoke Lambda Function\n\nThe function can be invoked using `curl` as below.\n```\ncurl --location --request POST 'http://localhost:9000/2015-03-31/functions/function/invocations' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"Item\": {\n        \"Title\": \"Hello, world.\",\n        \"Author\": \"John Doe, Jane Doe\",\n        \"ReleaseDate\": \"2021/11/18\",\n        \"ISBN10\": \"1234567890\",\n        \"Version\": \"2\"\n    }\n}'\n```\n\nIf you get a `200` response, you can verify the new item you've added by from the *Operation builder* menu of the NoSQL Workbench.\n\nFor `DemoTable` and with the way the `function` service was written, a book's uniqueness depends on its `ISBN10` and `ReleaseDate` values.\nIf a combination of these values were already submitted, the function should return a `500` response with a `ConditionalCheckFailedException` message.\nSee [Error Handling with DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html).\n\nBooks are suffixed by `Book` and are automatically prefixed with a number inclusively between 1 and 200.\nThis numeric prefix is computed from the `ISBN10` value for partitioning.\nSee [Using Write Sharding to Distribute Workloads Evenly](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-sharding.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdico%2Fdynamodb-local-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdico%2Fdynamodb-local-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdico%2Fdynamodb-local-demo/lists"}