hyper data adapter using AWS DynamoDB as service
This adapter uses single table design. All data for this adapter is stored in a single DynamoDB table with a partition key named "pk" and a sort key named "sk". The DynamoDB Table Name is defined as an environment variable, DynamoDbTable The tablename passed from hyper to this adapter becomes the "pk" The id passed from hyper to this adapter becomes the "sk" Everything else is stored in normal document format.
**Note: as of Nov. 2021, use deno version 1.15.3 to avoid conflicts with https://x.nest.land/hyper-app-opine
deno upgrade --version 1.15.3
- Create a DynamoDB table on AWS. The partion key is string type and named "pk". The sort key is string type and named "sk".
- Create an AWS IAM user with programmatic access and the ability to perform actions on this table.
- On gitpod, configure 4 environment variables (https://www.gitpod.io/docs/environment-variables)
awsAccessKeyId
awsSecretKey
region
DynamoDbTable - Spin up a gitpod instance by appending "gitpod.io/#" to the repo (gitpod.io/#https://github.com/cawilson1/hyper-adapter-dynamodb). You now have a coding environment with the DynamoDB environment variables injected.
- Downgrade deno to a non-conflicting version:
deno upgrade --version 1.15.3
- Start the dev env by running "./scripts/harness.sh"
- Do cool stuff
- In a terminal, start hyper "./scripts/harness.sh"
- In another terminal, run
HYPER=http://localhost:6363/test deno test --allow-net --allow-env --import-map=https://x.nest.land/[email protected]/import_map.json https://x.nest.land/[email protected]/mod.js
Add the following fields as secrets:
AWSACCESSKEYID
AWSSECRETKEY
REGION
TABLENAME
Ensure that you have provisioned enough throughput for the DynamoDB table to pass the test.