Amazon Lex
Developer Guide

Exercise 5: Create an Alias (AWS CLI)

An alias is a pointer to a specific version of a bot. With an alias you can easily update the version that your client applications are using. For more information, see Versioning and Aliases

To create an alias (AWS CLI)

  1. In the AWS CLI, get the version of the OrderFlowersBot bot that you created in Exercise 4: Publish a Version (AWS CLI).

    aws lex-models get-bot --name OrderFlowersBot --version-or-alias version > OrderFlowersBot_V5.json
  2. In a text editor, open OrderFlowersBot_v5.json. Find and record the version number.

  3. In the AWS CLI, create the bot alias:

    aws lex-models put-bot-alias --name PROD --bot-name OrderFlowersBot --bot-version version

    The following is the reponse from the server:

        "name": "PROD",
        "createdDate": timestamp,
        "checksum": "checksum",
        "lastUpdatedDate": timestamp,
        "botName": "OrderFlowersBot",
        "botVersion": "1"

Next Step

Exercise 6: Clean Up (AWS CLI)

On this page: