0

I am interested in building bot using AWS Lex but I don't want to use the AWS Lambda for interacting With DB for fetching results,

For Example. If we Ask, "Can you show me the sales for the last month" I want the bot to respond with an Answer " Sales for the last month $1.2 Million"; the Simplest way to achieve this to write an AWS Lambda function to get the details, but can we use an API Endpoint of a web app hosted on Ec2 Instance or AWS ELB

Any thoughts on this?

Surya

1 Answers1

1

Unfortunately no, you cannot use any form of integration for a Lex bot without going through Lambda. You can build Lex bots without Lambda, but they are only able to give static responses and can't call outside of the Lex service.

You can still use your own API endpoint by going via Lambda. Remember that if the resource your calling is in an AWS VPC but not publicly available, you'll need to add extra config for the Lambda to access it. Example of config required for Lambda to call a private AWS endpoint can be see here: AWS: Lambda function cannot call rest api using private API of EC2 instance.

From the Lex FAQs:

Q. How is an action fulfilled?

Amazon Lex integrates with AWS Lambda for ‘fulfillment’ of the action or business logic. Alternately, you can configure Amazon Lex to return parsed intent and slot values to the client for action fulfillment.

K Mo
  • 2,125
  • 8
  • 16
  • If My understanding is right, you are saying I call an API endpoint through AWS Lambda, but the endpoint should be an internal resource on our Infrastructure but not publicly available endpoint? – Surya C. Akasam Jun 12 '18 at 16:57
  • You can call a public or private endpoint from Lambda. It depends on your needs. – EpicVoyage Jun 12 '18 at 17:19
  • As I stated in my answer, "if the resource your calling is in an AWS VPC but not publicly available, you'll need to add extra config for the Lambda to access it". I'll update the answer with a reference of how to do that. – K Mo Jun 13 '18 at 05:57