How to call an existing Lambda function from Amplify-React?

Viewed 310

We have written Lambda functions AWS. Such as, pass a Contact Id and return a list of phone numbers of the contact (in json).

We are building an Amplify-React App. We want to call the existing Lambda functions. The Amplify React App and the Lambda functions are in the same AWS account and same region.

  1. Can we call the Lambda function directly in the Amplify-React App? Or, we must expose the Lambda functions in API gateway first?
  2. If we can call the Lambda function directly in Amplify-React, can you share the sample javascript to do so?
  3. Is there a best practice how to call an existing Lambda function in an Amplify-React App?
0 Answers
Related