Skip to content

Commit

Permalink
add dynamodb
Browse files Browse the repository at this point in the history
  • Loading branch information
if1live committed Sep 30, 2023
1 parent 936322a commit b10d854
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 178 deletions.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ services:
ports:
- 6379:6379

dynamodb:
image: amazon/dynamodb-local
ports:
- 8000:8000

adminer:
image: adminer:latest
ports:
Expand All @@ -34,3 +39,14 @@ services:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"

dynamodb-admin:
image: aaronshaf/dynamodb-admin:latest
environment:
DYNAMO_ENDPOINT: http://dynamodb:8000
PORT: 8083
AWS_REGION: ap-northeast-1
AWS_ACCESS_KEY_ID: local
AWS_SECRET_ACCESS_KEY: local
ports:
- 8083:8083
23 changes: 22 additions & 1 deletion etc/build_artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,28 @@ const opts: esbuild.BuildOptions = {
sourcemap: true,
treeShaking: true,
platform: "node",
external: [],
external: [
// aws-sdk v3 client
"@aws-sdk/client-dynamodb",
// aws-sdk v3 core
"@aws-sdk/s3-request-presigner",
"@aws-sdk/config-resolver",
"@aws-sdk/smithy-client",
"@aws-sdk/middleware-endpoint",
"@aws-sdk/middleware-user-agent",
"@aws-sdk/middleware-signing",
"@aws-sdk/signature-v4",
"@aws-sdk/signature-v4-multi-region",
"@aws-sdk/node-config-provider",
"@aws-sdk/node-http-handler",
"@aws-sdk/types",
"@aws-sdk/s3-request-presigner",
"@aws-sdk/protocol-http",
"@aws-sdk/util-format-url",
"@aws-sdk/util-arn-parser",
"@aws-sdk/util-uri-escape",
"@aws-sdk/querystring-builder",
],
target: "node18",
format: "esm",
mainFields: ["module", "main"],
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"sideEffects": false,
"type": "module",
"module": "dist/src/index.js",
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"files": [
"dist",
Expand All @@ -22,14 +22,14 @@
"bundle": "tsx etc/build_artifact.ts"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.421.0",
"@upstash/redis": "^1.22.1",
"dotenv": "^16.3.1",
"hono": "^3.7.3",
"ioredis": "^5.3.2",
"liquidjs": "^10.9.2",
"mysql2": "^3.6.1",
"pg": "^8.11.3",
"serverless-standalone": "^0.0.7"
"pg": "^8.11.3"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.122",
Expand All @@ -44,6 +44,7 @@
"rimraf": "^4.4.1",
"serverless": "^3.35.2",
"serverless-scriptable-plugin": "^1.3.1",
"serverless-standalone": "^0.0.7",
"tsx": "^3.13.0",
"typescript": "^5.2.2",
"vitest": "^0.33.0"
Expand Down
Loading

0 comments on commit b10d854

Please sign in to comment.