balmbees / dynamo-types

Typescript AWS DynamoDB ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add AWS config to documentation

MickL opened this issue · comments

This module looks awesome but I wonder how to use it with AWS. The readme shows no configuration of region, accessKeyId and secretAccessKey.

Also I wonder if it works with aws-sdk and if I might pass in my existing instance of it.

Could you add this to the readme example? Thanks so much!

commented

Hi. since the only official communication interface for DynamoDB is through aws-sdk, this library also utilizes node aws-sdk - which means you can use any methods among https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html here. I recommend https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html since that's most reliable way usually.
for passing in custom aws-sdk object, as of now it doesn't support it yet. sounds reasonable needs considering there are lot of use cases that need to mock / stub aws-sdk though, i'm open for contributon for that part.
thanks

Oh I see it automatically uses the environment variables. Anyway I am using LocalStack so I have to define a endpoint url and maybe other options within aws-sdk.

Would really appreciate to pass in a aws-sdk instance.

Also could you update the readme just with a sentence that it uses aws-sdk and the credentials can be set by those methods (link)?