serverless-seoul / dynamorm

AWS DynamoDB ORM in Typescript
Apache License 2.0
55 stars 4 forks source link

Possible to auth with our own configuration #13

Closed windht closed 3 years ago

windht commented 3 years ago

I noticed in the doc that this repo requires .env settings for credential init. Problem is if I want to deploy to lambda, those env keys are automatically dropped out by AWS. Any other way to set up the aws credential in code level?

breath103 commented 3 years ago

First, if you're trying to access dynamoDB from Lambda, proper way of doing it is by giving DynamoDB access to the lambda IAM role. https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_lambda-access-dynamodb.html this is intended design of Lambda to ensure secure runtime environment where you don't have hijackable master key.

So if you need this feature (overriding credential on runtime) just for that reason, i highly recommend to just use Lambda IAM Role setting. if you have other usage for this feature, let me know. thanks

windht commented 3 years ago

Thanks a lot! Closing this.