In this step we will link the three intents we created to the Lambda function. We do this by providing the Lambda function as the method that contains the business logic used to ‘fulfill’ the users requests. Once this is done (and the bot rebuilt), when a user specifies an intent (such as ‘what is my checking account balance’), Lex will call our Lambda function and pass it the intent name (‘GetAccountDetail’) and the slot value (‘checking’). To do this, we go back to the Lex Console
Click on PersonalBanker
Ensure the GetAccountDetail
intent is selected
Make sure that the ‘Latest’ version is selected
Scroll down to Fulfillment, select WS Lambda function,
choose bot-personal-assistant
and click OK in the popup warning window
which opens. It indicates you are giving Lex the permission to run this Lambda function.
Click Save Intent
Repeat the above steps for intents GetLoanDetail
and GetLoanProducts
Click Build and then click Build again on the confirmation screen