Search code examples
amazon-web-servicesamazon-lex

How do I build an Amazon Lex Bot using the rest API?


According to http://docs.aws.amazon.com/lex/latest/dg/API_Operations_Amazon_Lex_Model_Building_Service.html you can create or update bots and intents/slots (Put{Bot|Intend|Slot}, Create{Bot|Intend|Slot}Version).

So by using Put* I can configure a bot and with Create*Version I can publish one, but in order to publish it, first you need to build it and I can't find an API method for that.


Solution

  • When using PutBot you can supply the --process-behavior flag with value BUILD to force a build.

    From the documentation:

    If you set the processBehavior element to Build, Amazon Lex builds the bot so that it can be run. If you set the element to Save Amazon Lex saves the bot, but doesn't build it. If you don't specify this value, the default value is Save.