Access dynamodb with Angular

天涯浪子 提交于 2019-12-11 15:57:09

问题


I am new to AWS and plan to use Angular to make http request to endpoints to access DynamoDB. I am not sure which option to use since I see there is 1. Dynamodb's web services 2. use API Gateway to call lambda that call dynamodb. Could someone help me to understand what is the preferred method to access dynamodb from a front-end framework and why? Thank you!


回答1:


It's not good idea to call DynamoDB from Angular(JavaScript). It doesn't comes under the AWS best practices. The reason is you have to hard code the AccessKey and SecretKey in your Javascript file. If it's a project need you can use Amazon Cognito instead.

Better you can use the Lambda and API Gateway. Invoke the API Gateway endpoint from your Angular file which in background will trigger the Lambda function which has the code Call the DynamoDB Table and return back the results. The below link explains the Process.

Fronted => API Gateway => Lambda => DynamoDB



来源:https://stackoverflow.com/questions/48414078/access-dynamodb-with-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!