Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Exercise 5: Create an Alias (AWS CLI)

Focus mode
Exercise 5: Create an Alias (AWS CLI) - Amazon Lex V1

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead. .

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead. .

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 run the commands in this exercise, you need to know the region where the commands will be run. For a list of regions, see Model Building Quotas .

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 \ --region region \ --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 \ --region region \ --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

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.