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.”

Step 3: Publish the Bot (AWS CLI)

Focus mode
Step 3: Publish the Bot (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. .

After you have published all of the slot types and intents that are used by your bot, you can publish the bot.

Update the OrderFlowersBot bot to use the OrderFlowers intent that you updated in the previous step. Then, publish a new version of the OrderFlowersBot bot.

Note

The following AWS CLI example is formatted for Unix, Linux, and macOS. For Windows, change "\$LATEST" to $LATEST and replace the backslash (\) continuation character at the end of each line with a caret (^).

To publish a version of a bot (AWS CLI)
  1. In the AWS CLI, get the $LATEST version of the OrderFlowersBot bot and save it to a file:

    aws lex-models get-bot \ --region region \ --name OrderFlowersBot \ --version-or-alias "\$LATEST" > OrderFlowersBot_V4.json
  2. In a text editor, open the OrderFlowersBot_V4.json file. Delete the createdDate, lastUpdatedDate, status and version fields. Find the OrderFlowers intent and change the version to the version number that you recorded in the previous step. The following fragment of OrderFlowersBot_V4.json shows the location of the change.

        "intents": [
            {
                "intentVersion": "version", 
                "intentName": "OrderFlowers"
            }
  3. In the AWS CLI, save the new revision of the bot. Make note of the version number returned by the call to put-bot.

    aws lex-models put-bot \ --name OrderFlowersBot \ --cli-input-json file://OrderFlowersBot_V4.json
  4. Get the checksum of the latest revision of the bot. Use the version number returned in step 3.

    aws lex-models get-bot \ --region region \ --version-or-alias version \ --name OrderFlowersBot > OrderFlowersBot_V4a.json

    The following fragment of the response shows the checksum of the bot. Record this for the next step.

        "name": "OrderFlowersBot", 
        "locale": "en-US", 
        "checksum": "checksum", 
  5. Publish a new version of the bot:

    aws lex-models create-bot-version \ --region region \ --name OrderFlowersBot \ --checksum "checksum"

    The following fragment of the response shows the new version of the bot.

        "checksum": "checksum", 
        "abortStatement": {
            ...
        }, 
        "version": "1",
        "lastUpdatedDate": timestamp, 
    

Next Step

Exercise 5: Create an Alias (AWS CLI)

On this page

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