Update Amplify datastore from AWS lambda function

Viewed 1132

In my application, there is functionality that when we upload files in s3 then related AWS Lambda trigger is invoked. When Lambda function trigger I want to store file related data in AWS Amplify data store. Is this possible to access AWS Amplify data store in Lambda function? Any references?

s3 ---> Lambda function trigger ---> Amplify Datastore

Note: I found that we can add data from Lambda function to DynamoDB, but my app is using in AWS Amplify data store.

3 Answers

You can use the API feature of Amplify to enable access to features like DataStore. Take a look at this reference.

There is no difference for Amplify. Amplify data store uses Dynamodb. So you would need to grant IAM policy to your lambda function to have access to the db. read this reference

Related