1

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 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

You can call DynamoDB from Javascript without hard coding your keys in a file. You can use Cognito tokens instead docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.