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. .
Step 2: Publish the Intent (AWS CLI)
Before you can publish an intent, you have to publish all of the slot types
referred to by the intent. The slot types must be numbered versions, not the
$LATEST version.
First, update the OrderFlowers intent to use the version of the
FlowerTypes slot type that you published in the previous step. Then
publish a new version of the OrderFlowers intent.
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 an intent (AWS CLI)
-
In the AWS CLI, get the
$LATESTversion of theOrderFlowersintent and save it to a file:aws lex-models get-intent \ --regionregion\ --name OrderFlowers \ --intent-version "\$LATEST" > OrderFlowers_V4.json -
In a text editor, open the
OrderFlowers_V4.jsonfile. Delete thecreatedDate,lastUpdatedDate, andversionfields. Find theFlowerTypesslot type and change the version to the version number that you recorded in the previous step. The following fragment of theOrderFlowers_V4.jsonfile shows the location of the change:{ "slotType": "FlowerTypes", "name": "FlowerType", "slotConstraint": "Required", "valueElicitationPrompt": { "maxAttempts": 2, "messages": [ { "content": "What type of flowers?", "contentType": "PlainText" } ] }, "priority": 1, "slotTypeVersion": "
version", "sampleUtterances": [] }, -
In the AWS CLI, save the revision of the intent:
aws lex-models put-intent \ --name OrderFlowers \ --cli-input-json file://OrderFlowers_V4.json -
Get the checksum of the latest revision of the intent:
aws lex-models get-intent \ --regionregion\ --name OrderFlowers \ --intent-version "\$LATEST" > OrderFlowers_V4a.jsonThe following fragment of the response shows the checksum of the intent. Record this for the next step.
"name": "OrderFlowers", "checksum": "checksum", "version": "$LATEST", -
Publish a new version of the intent:
aws lex-models create-intent-version \ --regionregion\ --name OrderFlowers \ --checksum "checksum"The following fragment of the response shows the new version of the intent. Record the version number for the next step.
"name": "OrderFlowers", "checksum": "checksum", "version": "version",
Next Step
Step 3: Publish the Bot (AWS CLI)