Step 2: Create a Lambda Function - Amazon Lex V1

If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.

 

If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.

Step 2: Create a Lambda Function

In this section, you create a Lambda function using a blueprint (lex-make-appointment-python) that is provided in the Lambda console. You also test the Lambda function by invoking it using sample Amazon Lex event data that is provided by the console.

  1. Sign in to the AWS Management Console and open the AWS Lambda console at https://console.aws.amazon.com/lambda/.

  2. Choose Create a Lambda function.

  3. For Select blueprint, type lex to find the blueprint, and then choose the lex-make-appointment-python blueprint.

  4. Configure the Lambda function as follows.

    • Type the Lambda function name (MakeAppointmentCodeHook).

    • For the role, choose Create a new role from template(s), and then type a role name.

    • Leave other default values.

  5. Choose Create Function.

  6. If you are using a locale other than English (US) (en-US), update the intent names as described in Updating a Blueprint for a Specific Locale.

  7. Test the Lambda function.

    1. Choose Actions, and then chooseConfigure test event.

    2. From the Sample event template list, choose Lex-Make Appointment (preview). This sample event uses the Amazon Lex request/response model, with values set to match a request from your Amazon Lex bot. For information about the Amazon Lex request/response model, see Using Lambda Functions.

    3. Choose Save and test.

    4. Verify that the Lambda function ran successfully. The response in this case matches the Amazon Lex response model.

Next Step

Step 3: Update the Intent: Configure a Code Hook